Learn R Programming

RGtk2 (version 2.8.8)

GtkExpander: GtkExpander

Description

A container which can hide its child

Arguments

Methods and Functions

gtkExpanderNew(label = NULL, show = TRUE) gtkExpanderNewWithMnemonic(label = NULL) gtkExpanderSetExpanded(object, expanded) gtkExpanderGetExpanded(object) gtkExpanderSetSpacing(object, spacing) gtkExpanderGetSpacing(object) gtkExpanderSetLabel(object, label = NULL) gtkExpanderGetLabel(object) gtkExpanderSetUseUnderline(object, use.underline) gtkExpanderGetUseUnderline(object) gtkExpanderSetUseMarkup(object, use.markup) gtkExpanderGetUseMarkup(object) gtkExpanderSetLabelWidget(object, label.widget = NULL) gtkExpanderGetLabelWidget(object) gtkExpander(label = NULL, show = TRUE)

Hierarchy

\link{GObject} +----\link{GtkObject} +----\link{GtkWidget} +----\link{GtkContainer} +----\link{GtkBin} +----GtkExpander

Interfaces

GtkExpander implements AtkImplementorIface.

Detailed 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 gtkContainerAdd 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 */ } }

Convenient Construction

gtkExpander is the equivalent of gtkExpanderNew.

References

http://developer.gnome.org/doc/API/2.0/gtk/GtkExpander.html