11.58Class GtkExpander

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_expandedQueries a GtkExpander and returns its current state.
get_labelFetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup, as set by gtk_expander_set_label().
get_label_widgetRetrieves the label widget for the frame.
get_spacingGets the value set by gtk_expander_set_spacing().
get_use_markupReturns whether the label's text is interpreted as marked up with the Pango text markup language.
get_use_underlineReturns whether an embedded underline in the expander label indicates a mnemonic.
new_with_mnemonicCreates a new expander using label as the text of the label.
set_expandedSets the state of the expander.
set_labelSets the text of the label of the expander to label.
set_label_widgetSet the label widget for the expander. This is the widget that will appear embedded alongside the expander arrow.
set_spacingSets the spacing field of expander, which is the number of pixels to place between expander and the child.
set_use_markupSets whether the text of the label contains markup in Pango's text markup language.
set_use_underlineIf true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key.

Methods

get_expanded

Queries a GtkExpander and returns its current state.

GtkExpander.get_expanded()
Returnthe current state of the expander.

Returns true if the child widget is revealed.

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().

GtkExpander.get_label()
ReturnThe 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.

get_label_widget

Retrieves the label widget for the frame.

GtkExpander.get_label_widget()
Returnthe label widget, or nil if there is none

get_spacing

Gets the value set by gtk_expander_set_spacing().

GtkExpander.get_spacing()
Returnspacing between the expander and child.

get_use_markup

Returns whether the label's text is interpreted as marked up with the Pango text markup language.

GtkExpander.get_use_markup()
Returntrue if the label's text will be parsed for markup

get_use_underline

Returns whether an embedded underline in the expander label indicates a mnemonic.

GtkExpander.get_use_underline()
Returntrue if an embedded underline in the expander label indicates the mnemonic accelerator keys.

new_with_mnemonic

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.

set_expanded

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.

set_label

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_label_widget

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)

set_spacing

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.

set_use_markup

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

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.

GtkExpander.set_use_underline( use_underline )
use_underline true if underlines in the text indicate mnemonics
Made with http://www.falconpl.org