A container which can hide its child
Class GtkExpander( [label] )
label | the text of the label |
A GtkExpander allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a GtkTreeView.
Normally you use an expander as you would use any other descendant of GtkBin; you create the child widget and use gtk_container_add() to add it to the expander. When the expander is toggled, it will take care of showing and hiding the child automatically.
Methods | |
get_expanded | Queries a GtkExpander and returns its current state. |
get_label | Fetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup, as set by gtk_expander_set_label(). |
get_label_widget | Retrieves the label widget for the frame. |
get_spacing | Gets the value set by gtk_expander_set_spacing(). |
get_use_markup | Returns whether the label's text is interpreted as marked up with the Pango text markup language. |
get_use_underline | Returns whether an embedded underline in the expander label indicates a mnemonic. |
new_with_mnemonic | Creates a new expander using label as the text of the label. |
set_expanded | Sets the state of the expander. |
set_label | Sets the text of the label of the expander to label. |
set_label_widget | Set the label widget for the expander. This is the widget that will appear embedded alongside the expander arrow. |
set_spacing | Sets the spacing field of expander, which is the number of pixels to place between expander and the child. |
set_use_markup | Sets whether the text of the label contains markup in Pango's text markup language. |
set_use_underline | If true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key. |
Queries a GtkExpander and returns its current state.
GtkExpander.get_expanded()
Return | the current state of the expander. |
Returns true if the child widget is revealed.
Fetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup, as set by gtk_expander_set_label().
GtkExpander.get_label()
Return | The text of the label widget. |
If the label text has not been set the return value will be NULL. This will be the case if you create an empty button with gtk_button_new() to use as a container.
Note that this function behaved differently in versions prior to 2.14 and used to return the label text stripped of embedded underlines indicating mnemonics and Pango markup. This problem can be avoided by fetching the label text directly from the label widget.
Retrieves the label widget for the frame.
GtkExpander.get_label_widget()
Return | the label widget, or nil if there is none |
Gets the value set by gtk_expander_set_spacing().
GtkExpander.get_spacing()
Return | spacing between the expander and child. |
Returns whether the label's text is interpreted as marked up with the Pango text markup language.
GtkExpander.get_use_markup()
Return | true if the label's text will be parsed for markup |
Returns whether an embedded underline in the expander label indicates a mnemonic.
GtkExpander.get_use_underline()
Return | true if an embedded underline in the expander label indicates the mnemonic accelerator keys. |
Creates a new expander using label as the text of the label.
GtkExpander.new_with_mnemonic( label )
label | the text of the label |
If characters in label are preceded by an underscore, they are 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.
Sets the state of the expander.
GtkExpander.set_expanded( expanded )
expanded | whether the child widget is revealed |
Set to true, if you want the child widget to be revealed, and false if you want the child widget to be hidden.
Sets the text of the label of the expander to label.
GtkExpander.set_label( [label] )
label | a string |
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.
GtkExpander.set_label_widget( label_widget )
label_widget | the new label widget (or nil) |
Sets the spacing field of expander, which is the number of pixels to place between expander and the child.
GtkExpander.set_spacing( distance )
distance | between the expander and child in pixels. |
Sets whether the text of the label contains markup in Pango's text markup language.
GtkExpander.set_use_markup( use_markup )
use_markup | true if the label's text should be parsed for markup |
If true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key.
GtkExpander.set_use_underline( use_underline )
use_underline | true if underlines in the text indicate mnemonics |