Expander

Description 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. 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 a GtkExpander 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 = gtk_expander_new_with_mnemonic ("_More Options"); g_signal_connect (expander, "notify::expanded", G_CALLBACK (expander_callback), NULL); ... static void expander_callback (GObject *object, GParamSpec *param_spec, gpointer user_data) { * GtkExpander *expander; * expander = GTK_EXPANDER (object); * if (gtk_expander_get_expanded (expander)) * { * /+* Show or create widgets +/ * } * else * { * /+* Hide or destroy widgets +/ * } } GtkExpander as GtkBuildable The GtkExpander implementation of the GtkBuildable interface supports placing a child in the label position by specifying "label" as the "type" attribute of a <child> element. A normal content child can be specified without specifying a <child> type attribute.

Constructors

this
this(GtkExpander* gtkExpander)

Sets our main struct and passes it to the parent class

this
this(string label, bool mnemonic)

Creates a new expander using label as the text of the label. Since 2.4

Members

Functions

addOnActivate
void addOnActivate(void delegate(Expander) dlg, ConnectFlags connectFlags)
getExpanded
int getExpanded()

Queries a GtkExpander and returns its current state. Returns TRUE if the child widget is revealed. See gtk_expander_set_expanded(). Since 2.4

getExpanderStruct
GtkExpander* getExpanderStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getLabel
string getLabel()

Fetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup, as set by gtk_expander_set_label(). 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. Since 2.4

getLabelFill
int getLabelFill()

Returns whether the label widget will fill all available horizontal space allocated to expander. Since 2.22

getLabelWidget
Widget getLabelWidget()

Retrieves the label widget for the frame. See gtk_expander_set_label_widget(). Since 2.4

getSpacing
int getSpacing()

Gets the value set by gtk_expander_set_spacing(). Since 2.4

getStruct
void* getStruct()

the main Gtk struct as a void*

getUseMarkup
int getUseMarkup()

Returns whether the label's text is interpreted as marked up with the Pango text markup language. See gtk_expander_set_use_markup(). Since 2.4

getUseUnderline
int getUseUnderline()

Returns whether an embedded underline in the expander label indicates a mnemonic. See gtk_expander_set_use_underline(). Since 2.4

setExpanded
void setExpanded(int expanded)

Sets the state of the expander. Set to TRUE, if you want the child widget to be revealed, and FALSE if you want the child widget to be hidden. Since 2.4

setLabel
void setLabel(string label)

Sets the text of the label of the expander to label. This will also clear any previously set labels. Since 2.4

setLabelFill
void setLabelFill(int labelFill)

Sets whether the label widget should fill all available horizontal space allocated to expander. Since 2.22

setLabelWidget
void setLabelWidget(Widget labelWidget)

Set the label widget for the expander. This is the widget that will appear embedded alongside the expander arrow. Since 2.4

setSpacing
void setSpacing(int spacing)

Sets the spacing field of expander, which is the number of pixels to place between expander and the child. Since 2.4

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setUseMarkup
void setUseMarkup(int useMarkup)

Sets whether the text of the label contains markup in Pango's text markup language. See gtk_label_set_markup(). Since 2.4

setUseUnderline
void setUseUnderline(int useUnderline)

If true, an underline in the text of the expander label indicates the next character should be used for the mnemonic accelerator key. Since 2.4

Static functions

callBackActivate
void callBackActivate(GtkExpander* expanderStruct, Expander _expander)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkExpander
GtkExpander* gtkExpander;

the main Gtk struct

onActivateListeners
void delegate(Expander)[] onActivateListeners;
Undocumented in source.

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getChild
Widget getChild()

Gets the child of the GtkBin, or NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

Meta