<html> <head><title>Gtk-- Reference: Gtk::AccelLabel</title></head> <body bgcolor="#F0F0F0" text="#000000" link="#0000FF" vlink="#000077" alink="#FF0000"> <table align=center border=0 cellspacing=10> <tr> <td><a href="class_index.html">Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="name_index.html">Namespace Index</a></td> </table> <h1 align=center>Class Gtk::AccelLabel</h1><p> <b> A label which displays an accelerator key to the right of the text.</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3ALabel.html">Gtk::Label</a> <br> Derived by: <i>none</i> <p> #include <gtk--/accellabel.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=right><tt><tt>explicit</tt> </tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#55"><tt><font color=blue><b>AccelLabel</b></font></tt></a></td><td><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>label</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>guint</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#56"><tt><font color=blue><b>get_accel_width</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkAccelLabel</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#51"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <tt><font color=navy>GtkAccelLabel</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#52"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#53"><tt><font color=blue><b>isA</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#58"><tt><font color=blue><b>refetch</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#57"><tt><font color=blue><b>set_accel_widget</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a>& <tt><font color=blue>accel_widget</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3AAccelLabel.html#54"><tt><font color=blue><b>~AccelLabel</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> The <tt><tt><font color=blue>Gtk::AccelLabel</font></tt></tt> widget is a subclass of <tt><tt><font color=blue>Gtk::Label</font></tt></tt> that also displays an accelerator key to the right of the label text, e.g. 'Ctl+S'. It is commonly used in menus to show the keyboard short-cuts for commands. <P> The accelerator key to display is not set explicitly. Instead, the <tt><tt><font color=blue>Gtk::AccelLabel</font></tt></tt> displays the accelerators which have been added to a particular widget. This widget is set by calling <a href="Gtk%3A%3AAccelLabel.html#57"><tt><font color=blue><b>set_accel_widget</b></font></tt></a>. For example, a <tt><tt><font color=blue>Gtk::MenuItem</font></tt></tt> widget may have an accelerator added to emit the "activate" signal when the 'Ctl+S' key combination is pressed. A <tt><tt><font color=blue>Gtk::AccelLabel</font></tt></tt> is created and added to the <tt><tt><font color=blue>Gtk::MenuItem</font></tt></tt>, and <a href="Gtk%3A%3AAccelLabel.html#57"><tt><font color=blue><b>set_accel_widget</b></font></tt></a> is called with the <tt><tt><font color=blue>Gtk::MenuItem</font></tt></tt> as the argument. The <tt><tt><font color=blue>Gtk::AccelLabel</font></tt></tt> will now display 'Ctl+S' after its label.<br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="55"><font size=+1><b>Gtk::AccelLabel::AccelLabel</b></font></a> - Creates a new <tt><tt><font color=blue>Gtk::AccelLabel</font></tt></tt>.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>explicit</tt> </tt> <a href="Gtk%3A%3AAccelLabel.html#55"><tt><font color=blue><b>AccelLabel</b></font></tt></a><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>label</font></tt>)</tt>;<br><blockquote> string: The label string.</blockquote> <br><br> <a name="51"><font size=+1><b>Gtk::AccelLabel::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkAccelLabel</font></tt>*</tt> <a href="Gtk%3A%3AAccelLabel.html#51"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="53"><font size=+1><b>Gtk::AccelLabel::isA</b></font></a> - Returns true if object is this type.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AAccelLabel.html#53"><tt><font color=blue><b>isA</b></font></tt></a><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;<br><br> <a name="58"><font size=+1><b>Gtk::AccelLabel::refetch</b></font></a> - Recreates the string representing the accelerator keys.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AAccelLabel.html#58"><tt><font color=blue><b>refetch</b></font></tt></a><tt>()</tt>;<br><blockquote> This should not be needed since the string is automatically updated whenever accelerators are added or removed from the associated widget.</blockquote> <br><br> <a name="57"><font size=+1><b>Gtk::AccelLabel::set_accel_widget</b></font></a> - Sets the widget whose accelerators are to be shown.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AAccelLabel.html#57"><tt><font color=blue><b>set_accel_widget</b></font></tt></a><tt>(<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a>& <tt><font color=blue>accel_widget</font></tt>)</tt>;<br><br> <hr noshade> </html>