<html> <head><title>Gtk-- Reference: Gtk::ToggleButton</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::ToggleButton</h1><p> <b> Button with two states</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3AButton.html">Gtk::Button</a> <br> Derived by: <a href="Gtk::CheckButton.html">Gtk::CheckButton</a> <p> #include <gtk--/togglebutton.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> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#2998"><tt><font color=blue><b>ToggleButton</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>explicit</tt> </tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#2999"><tt><font color=blue><b>ToggleButton</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><font color=purple>gfloat</font></tt> <tt><font color=blue>x</font></tt>=0.5, <tt><font color=purple>gfloat</font></tt> <tt><font color=blue>y</font></tt>=0.5)</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%3AToggleButton.html#3003"><tt><font color=blue><b>get_active</b></font></tt></a></td><td><tt>() <tt>const</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%3AToggleButton.html#3001"><tt><font color=blue><b>get_mode</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkToggleButton</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#2994"><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>GtkToggleButton</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#2995"><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%3AToggleButton.html#2996"><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>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#3002"><tt><font color=blue><b>set_active</b></font></tt></a></td><td><tt>(<tt><font color=purple>bool</font></tt> <tt><font color=blue>is_active</font></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%3AToggleButton.html#3000"><tt><font color=blue><b>set_mode</b></font></tt></a></td><td><tt>(<tt><font color=purple>bool</font></tt> <tt><font color=blue>draw_indicator</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>emitable</tt> <tt>signal</tt> <tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#3004"><tt><font color=blue><b>toggled</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#2997"><tt><font color=blue><b>~ToggleButton</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td><tr><td colspan=3><h3>protected function member index:</h3></td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AToggleButton.html#3005"><tt><font color=blue><b>toggled_impl</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> The togglebutton has the look of a regular button, but the action of a checkbutton. It can be switched between two states by clicking on it. Like the button, it can hold another widget inside it.<br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="2998"><font size=+1><b>Gtk::ToggleButton::ToggleButton</b></font></a> - Create an empty toggle button.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt></tt> <a href="Gtk%3A%3AToggleButton.html#2998"><tt><font color=blue><b>ToggleButton</b></font></tt></a><tt>()</tt>;<br><blockquote> With an empty button, you can <tt><tt><font color=navy><b>Gtk::Button</b></font></tt>::<tt><font color=blue><b>add</b></font></tt></tt> a widget such as a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3APixmap.html"><tt><font color=navy><b>Pixmap</b></font></tt></a></tt> or <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3ABox.html"><tt><font color=navy><b>Box</b></font></tt></a></tt>. <P> If you just wish to add a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3ALabel.html"><tt><font color=navy><b>Label</b></font></tt></a></tt>, you may want to use the {ToggleButton(const string &label)} ctor directly instead.</blockquote> <br><br> <a name="2999"><font size=+1><b>Gtk::ToggleButton::ToggleButton</b></font></a> - Create a check button with a label.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>explicit</tt> </tt> <a href="Gtk%3A%3AToggleButton.html#2999"><tt><font color=blue><b>ToggleButton</b></font></tt></a><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>label</font></tt>, <tt><font color=purple>gfloat</font></tt> <tt><font color=blue>x</font></tt>=0.5, <tt><font color=purple>gfloat</font></tt> <tt><font color=blue>y</font></tt>=0.5)</tt>;<br><blockquote> You won't be able to add a widget in this button since it already has a <tt><font color=navy><b>Gtk_Label</b></font></tt> in it.</blockquote> <br><br> <a name="3003"><font size=+1><b>Gtk::ToggleButton::get_active</b></font></a> - Return the state of the indicator.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AToggleButton.html#3003"><tt><font color=blue><b>get_active</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> See <tt><tt><font color=blue>active</font></tt></tt>.</blockquote> <br><br> <a name="3001"><font size=+1><b>Gtk::ToggleButton::get_mode</b></font></a> - Returns whether the indicator will be drawn.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AToggleButton.html#3001"><tt><font color=blue><b>get_mode</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> See <tt><tt><font color=blue>draw_indicator</font></tt></tt>.</blockquote> <br><br> <a name="2994"><font size=+1><b>Gtk::ToggleButton::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkToggleButton</font></tt>*</tt> <a href="Gtk%3A%3AToggleButton.html#2994"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="2996"><font size=+1><b>Gtk::ToggleButton::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%3AToggleButton.html#2996"><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="3002"><font size=+1><b>Gtk::ToggleButton::set_active</b></font></a> - Set the state of the indicator.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AToggleButton.html#3002"><tt><font color=blue><b>set_active</b></font></tt></a><tt>(<tt><font color=purple>bool</font></tt> <tt><font color=blue>is_active</font></tt>)</tt>;<br><br> <a name="3000"><font size=+1><b>Gtk::ToggleButton::set_mode</b></font></a> - Set whether the indicator will be drawn.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AToggleButton.html#3000"><tt><font color=blue><b>set_mode</b></font></tt></a><tt>(<tt><font color=purple>bool</font></tt> <tt><font color=blue>draw_indicator</font></tt>)</tt>;<br><blockquote> See <tt><tt><font color=blue>draw_indicator</font></tt></tt>.</blockquote> <br><br> <a name="3004"><font size=+1><b>Gtk::ToggleButton::toggled</b></font></a> - Emitted on a change of button state.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>emitable</tt> <tt>signal</tt> <tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AToggleButton.html#3004"><tt><font color=blue><b>toggled</b></font></tt></a><tt>()</tt>;<br><tt><tt>virtual</tt> <tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AToggleButton.html#3005"><tt><font color=blue><b>toggled_impl</b></font></tt></a><tt>()</tt>;<br><blockquote> Triggered when the button changes state (Note : changing the button's state with <a href="Gtk%3A%3AToggleButton.html#3002"><tt><font color=blue><b>set_active</b></font></tt></a> will also trigger this signal).</blockquote> <br><br> <hr noshade> </html>