47
47
#include <gtk/gtk.h>
49
49
<a class="link" href="GtkAccelLabel.html#GtkAccelLabel-struct" title="GtkAccelLabel">GtkAccelLabel</a>;
50
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* <a class="link" href="GtkAccelLabel.html#gtk-accel-label-new" title="gtk_accel_label_new ()">gtk_accel_label_new</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
50
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* <a class="link" href="GtkAccelLabel.html#gtk-accel-label-new" title="gtk_accel_label_new ()">gtk_accel_label_new</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
51
51
<span class="returnvalue">void</span> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-closure" title="gtk_accel_label_set_accel_closure ()">gtk_accel_label_set_accel_closure</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
52
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *accel_closure</code></em>);
52
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *accel_closure</code></em>);
53
53
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* <a class="link" href="GtkAccelLabel.html#gtk-accel-label-get-accel-widget" title="gtk_accel_label_get_accel_widget ()">gtk_accel_label_get_accel_widget</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
54
54
<span class="returnvalue">void</span> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-widget" title="gtk_accel_label_set_accel_widget ()">gtk_accel_label_set_accel_widget</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
55
55
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *accel_widget</code></em>);
56
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-get-accel-width" title="gtk_accel_label_get_accel_width ()">gtk_accel_label_get_accel_width</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
57
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-refetch" title="gtk_accel_label_refetch ()">gtk_accel_label_refetch</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
56
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-get-accel-width" title="gtk_accel_label_get_accel_width ()">gtk_accel_label_get_accel_width</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
57
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-refetch" title="gtk_accel_label_refetch ()">gtk_accel_label_refetch</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
60
60
<div class="refsect1" title="Object Hierarchy">
61
61
<a name="GtkAccelLabel.object-hierarchy"></a><h2>Object Hierarchy</h2>
62
62
<pre class="synopsis">
63
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
64
+----<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
63
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
64
+----<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
65
65
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
66
66
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
67
67
+----<a class="link" href="GtkMisc.html" title="GtkMisc">GtkMisc</a>
78
78
<div class="refsect1" title="Properties">
79
79
<a name="GtkAccelLabel.properties"></a><h2>Properties</h2>
80
80
<pre class="synopsis">
81
"<a class="link" href="GtkAccelLabel.html#GtkAccelLabel--accel-closure" title='The "accel-closure" property'>accel-closure</a>" <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a>* : Read / Write
81
"<a class="link" href="GtkAccelLabel.html#GtkAccelLabel--accel-closure" title='The "accel-closure" property'>accel-closure</a>" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a>* : Read / Write
82
82
"<a class="link" href="GtkAccelLabel.html#GtkAccelLabel--accel-widget" title='The "accel-widget" property'>accel-widget</a>" <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>* : Read / Write
115
115
though it is almost always used to display just one accelerator key.
117
117
<div class="example">
118
<a name="id709057"></a><p class="title"><b>Example 11. Creating a simple menu item with an accelerator key.</b></p>
118
<a name="id505951"></a><p class="title"><b>Example 11. Creating a simple menu item with an accelerator key.</b></p>
119
119
<div class="example-contents">
120
120
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
141
<td class="listing_code"><pre class="programlisting"><span class="normal"><a href="GtkWidget.html">GtkWidget</a> </span><span class="symbol">*</span><span class="normal">save_item</span><span class="symbol">;</span>
142
<span class="normal"><a href="gtk-Keyboard-Accelerators.html#GtkAccelGroup">GtkAccelGroup</a> </span><span class="symbol">*</span><span class="normal">accel_group</span><span class="symbol">;</span>
141
<td class="listing_code"><pre class="programlisting"><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">save_item</span><span class="symbol">;</span>
142
<span class="usertype">GtkAccelGroup</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">accel_group</span><span class="symbol">;</span>
144
144
<span class="comment">/* Create a GtkAccelGroup and add it to the window. */</span>
145
145
<span class="normal">accel_group </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gtk-Keyboard-Accelerators.html#gtk-accel-group-new">gtk_accel_group_new</a></span><span class="normal"> </span><span class="symbol">();</span>
155
155
<span class="comment"> GtkAccelLabel is automatically set up to display the GtkMenuItem</span>
156
156
<span class="comment"> accelerators. We just need to make sure we use GTK_ACCEL_VISIBLE here. */</span>
157
157
<span class="function"><a href="GtkWidget.html#gtk-widget-add-accelerator">gtk_widget_add_accelerator</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">save_item</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"activate"</span><span class="symbol">,</span><span class="normal"> accel_group</span><span class="symbol">,</span>
158
<span class="normal"> GDK_s</span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/gdk/gdk-Windows.html#GDK-CONTROL-MASK:CAPS">GDK_CONTROL_MASK</a></span><span class="symbol">,</span><span class="normal"> GTK_ACCEL_VISIBLE</span><span class="symbol">);</span></pre></td>
158
<span class="normal"> GDK_s</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#GDK-CONTROL-MASK:CAPS">GDK_CONTROL_MASK</a></span><span class="symbol">,</span><span class="normal"> GTK_ACCEL_VISIBLE</span><span class="symbol">);</span></pre></td>
179
179
<div class="refsect2" title="gtk_accel_label_new ()">
180
180
<a name="gtk-accel-label-new"></a><h3>gtk_accel_label_new ()</h3>
181
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* gtk_accel_label_new (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
181
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* gtk_accel_label_new (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
183
183
Creates a new <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>.
189
189
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
190
<td>the label string. Must be non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
190
<td>the label string. Must be non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
202
202
<div class="refsect2" title="gtk_accel_label_set_accel_closure ()">
203
203
<a name="gtk-accel-label-set-accel-closure"></a><h3>gtk_accel_label_set_accel_closure ()</h3>
204
204
<pre class="programlisting"><span class="returnvalue">void</span> gtk_accel_label_set_accel_closure (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
205
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *accel_closure</code></em>);</pre>
205
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *accel_closure</code></em>);</pre>
207
207
Sets the closure to be monitored by this accelerator label. The closure
208
208
must be connected to an accelerator group; see <a class="link" href="gtk-Keyboard-Accelerators.html#gtk-accel-group-connect" title="gtk_accel_group_connect ()"><code class="function">gtk_accel_group_connect()</code></a>.
243
243
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
244
<td> the object monitored by the accelerator label, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
244
<td> the object monitored by the accelerator label, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
275
275
<div class="refsect2" title="gtk_accel_label_get_accel_width ()">
276
276
<a name="gtk-accel-label-get-accel-width"></a><h3>gtk_accel_label_get_accel_width ()</h3>
277
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_accel_label_get_accel_width (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
277
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_accel_label_get_accel_width (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
279
279
Returns the width needed to display the accelerator key(s).
280
280
This is used by menus to align all of the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> widgets, and shouldn't
300
300
<div class="refsect2" title="gtk_accel_label_refetch ()">
301
301
<a name="gtk-accel-label-refetch"></a><h3>gtk_accel_label_refetch ()</h3>
302
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_accel_label_refetch (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
302
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_accel_label_refetch (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
304
304
Recreates the string representing the accelerator keys.
305
305
This should not be needed since the string is automatically updated whenever
326
326
<a name="GtkAccelLabel.property-details"></a><h2>Property Details</h2>
327
327
<div class="refsect2" title='The "accel-closure" property'>
328
328
<a name="GtkAccelLabel--accel-closure"></a><h3>The <code class="literal">"accel-closure"</code> property</h3>
329
<pre class="programlisting"> "accel-closure" <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a>* : Read / Write</pre>
329
<pre class="programlisting"> "accel-closure" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a>* : Read / Write</pre>
330
330
<p>The closure to be monitored for accelerator changes.</p>