![]() |
![]() |
An Expander allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a Gtk::TreeView.
Normally you use an expander as you would use any other descendant of Gtk::Bin; you create the child widget and use add() to add it to the expander. When the expander is toggled, it will take care of showing and hiding the child automatically.
Special Usage: There are situations in which you may prefer to show and hide the expanded widget yourself, such as when you want to actually create the widget at expansion time. In this case, create an Expander but do not add a child to it. The expander widget has an expanded
property which can be used to monitor its expansion state. You should watch this property with a signal connection as follows:
expander.property_expanded().signal_changed().connect(
sigc::mem_fun(*this, &SomeClass::on_expander_changed)
);
Public Member Functions | |
Expander (const Glib::ustring& label, bool mnemonic=false) | |
Creates a new Expander with a label. | |
Expander () | |
Creates a new Expander. | |
bool | get_expanded () const |
Queries a Gtk::Expander and returns its current state. | |
Glib::ustring | get_label () const |
Fetches the text from the label of the expander, as set by set_label(). | |
const Widget* | get_label_widget () const |
Retrieves the label widget for the frame. | |
Widget* | get_label_widget () |
Retrieves the label widget for the frame. | |
int | get_spacing () const |
Gets the value set by set_spacing(). | |
bool | get_use_markup () const |
Returns whether the label's text is interpreted as marked up with the Pango text markup language. | |
bool | get_use_underline () const |
Returns whether an embedded underline in the expander label indicates a mnemonic. | |
const GtkExpander* | gobj () const |
Provides access to the underlying C GtkObject. | |
GtkExpander* | gobj () |
Provides access to the underlying C GtkObject. | |
Glib::PropertyProxy_ReadOnly< bool > | property_expanded () const |
Whether the expander has been opened to reveal the child widget. | |
Glib::PropertyProxy<bool> | property_expanded () |
Whether the expander has been opened to reveal the child widget. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_label () const |
Text of the expander's label. | |
Glib::PropertyProxy<Glib::ustring> | property_label () |
Text of the expander's label. | |
Glib::PropertyProxy_ReadOnly< Widget* > | property_label_widget () const |
A widget to display in place of the usual expander label. | |
Glib::PropertyProxy<Widget*> | property_label_widget () |
A widget to display in place of the usual expander label. | |
Glib::PropertyProxy_ReadOnly< int > | property_spacing () const |
Space to put between the label and the child. | |
Glib::PropertyProxy<int> | property_spacing () |
Space to put between the label and the child. | |
Glib::PropertyProxy_ReadOnly< bool > | property_use_markup () const |
The text of the label includes XML markup. | |
Glib::PropertyProxy<bool> | property_use_markup () |
The text of the label includes XML markup. | |
Glib::PropertyProxy_ReadOnly< bool > | property_use_underline () const |
If set. | |
Glib::PropertyProxy<bool> | property_use_underline () |
If set. | |
void | set_expanded (bool expanded=true) |
Sets the state of the expander. | |
void | set_label (const Glib::ustring& label) |
Sets the text of the label of the expander to label . | |
void | set_label_widget (Widget& label_widget) |
Set the label widget for the expander. | |
void | set_spacing (int spacing) |
Sets the spacing field of expander , which is the number of pixels to place between expander and the child. | |
void | set_use_markup (bool use_markup=true) |
Sets whether the text of the label contains markup in Pango's text markup language. | |
void | set_use_underline (bool use_underline=true) |
If true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key. | |
virtual | ~Expander () |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Expander* | wrap (GtkExpander* object, bool take_copy=false) |
|
|
|
Creates a new Expander. The Expander has an empty label.
|
|
Creates a new Expander with a label. Creates a new expander using label as the text of the label. Settin mnemonic to true will allow you to precede characters in the label with an underscore which will make them underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.
|
|
Queries a Gtk::Expander and returns its current state.
Returns See set_expanded().
|
|
Fetches the text from the label of the expander, as set by set_label().
If the label text has not been set the return value will be
|
|
Retrieves the label widget for the frame. See set_label_widget().
|
|
Retrieves the label widget for the frame. See set_label_widget().
|
|
Gets the value set by set_spacing().
|
|
Returns whether the label's text is interpreted as marked up with the Pango text markup language. See set_use_markup().
|
|
Returns whether an embedded underline in the expander label indicates a mnemonic. See set_use_underline().
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Bin. |
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Bin. |
|
Whether the expander has been opened to reveal the child widget. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Whether the expander has been opened to reveal the child widget. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Text of the expander's label. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Text of the expander's label. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A widget to display in place of the usual expander label. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A widget to display in place of the usual expander label. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Space to put between the label and the child. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Space to put between the label and the child. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The text of the label includes XML markup. See pango_parse_markup. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The text of the label includes XML markup. See pango_parse_markup. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Sets the state of the expander.
Set to
|
|
Sets the text of the label of the expander to label . This will also clear any previously set labels.
|
|
Set the label widget for the expander. This is the widget that will appear embedded alongside the expander arrow.
|
|
Sets the spacing field of expander , which is the number of pixels to place between expander and the child.
|
|
Sets whether the text of the label contains markup in Pango's text markup language.
|
|
If true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key.
|
|
|