package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Expander_Record, Gtk_Expander);
type Gtk_Expander_Record is new Gtk_Bin_Record with null record;
type Gtk_Expander is access all Gtk_Expander_Record'Class;
type Cb_Gtk_Expander_Void is not null access procedure (Self : access Gtk_Expander_Record'Class);
type Cb_GObject_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class);
Expanded_Property : constant Glib.Properties.Property_Boolean;
Label_Property : constant Glib.Properties.Property_String;
Label_Fill_Property : constant Glib.Properties.Property_Boolean;
Label_Widget_Property : constant Glib.Properties.Property_Object;
Resize_Toplevel_Property : constant Glib.Properties.Property_Boolean;
Spacing_Property : constant Glib.Properties.Property_Int;
Use_Markup_Property : constant Glib.Properties.Property_Boolean;
Use_Underline_Property : constant Glib.Properties.Property_Boolean;
Signal_Activate : constant Glib.Signal_Name := "activate";
procedure Gtk_New
( | Expander | : out Gtk_Expander; |
Label | : UTF8_String); |
procedure Initialize
( | Expander | : not null access Gtk_Expander_Record'Class; |
Label | : UTF8_String); |
function Gtk_Expander_New
( | Label | : UTF8_String) return Gtk_Expander; |
procedure Gtk_New_With_Mnemonic
( | Expander | : out Gtk_Expander; |
Label | : UTF8_String := ""); |
procedure Initialize_With_Mnemonic
( | Expander | : not null access Gtk_Expander_Record'Class; |
Label | : UTF8_String := ""); |
function Gtk_Expander_New_With_Mnemonic
( | Label | : UTF8_String := "") return Gtk_Expander; |
function Get_Type return Glib.GType;
function Get_Expanded
( | Expander | : not null access Gtk_Expander_Record) return Boolean; |
procedure Set_Expanded
( | Expander | : not null access Gtk_Expander_Record; |
Expanded | : Boolean); |
function Get_Label
( | Expander | : not null access Gtk_Expander_Record) return UTF8_String; |
procedure Set_Label
( | Expander | : not null access Gtk_Expander_Record; |
Label | : UTF8_String := ""); |
function Get_Label_Fill
( | Expander | : not null access Gtk_Expander_Record) return Boolean; |
procedure Set_Label_Fill
( | Expander | : not null access Gtk_Expander_Record; |
Label_Fill | : Boolean); |
function Get_Label_Widget
( | Expander | : not null access Gtk_Expander_Record) return Gtk.Widget.Gtk_Widget; |
procedure Set_Label_Widget
( | Expander | : not null access Gtk_Expander_Record; |
Label_Widget | : access Gtk.Widget.Gtk_Widget_Record'Class); |
function Get_Resize_Toplevel
( | Expander | : not null access Gtk_Expander_Record) return Boolean; |
procedure Set_Resize_Toplevel
( | Expander | : not null access Gtk_Expander_Record; |
Resize_Toplevel | : Boolean); |
function Get_Spacing
( | Expander | : not null access Gtk_Expander_Record) return Gint; |
procedure Set_Spacing
( | Expander | : not null access Gtk_Expander_Record; |
Spacing | : Gint); |
function Get_Use_Markup
( | Expander | : not null access Gtk_Expander_Record) return Boolean; |
procedure Set_Use_Markup
( | Expander | : not null access Gtk_Expander_Record; |
Use_Markup | : Boolean); |
function Get_Use_Underline
( | Expander | : not null access Gtk_Expander_Record) return Boolean; |
procedure Set_Use_Underline
( | Expander | : not null access Gtk_Expander_Record; |
Use_Underline | : Boolean); |
procedure On_Activate
( | Self | : not null access Gtk_Expander_Record; |
Call | : Cb_Gtk_Expander_Void; | |
After | : Boolean := False); |
procedure On_Activate
( | Self | : not null access Gtk_Expander_Record; |
Call | : Cb_GObject_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
function "+"
( | Widget | : access Gtk_Expander_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Expander renames Implements_Gtk_Buildable.To_Object; |
A Gtk.Expander.Gtk_Expander allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a Gtk.Tree_View.Gtk_Tree_View.
Normally you use an expander as you would use any other descendant of Gtk.Bin.Gtk_Bin; 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 Gtk.Expander.Gtk_Expander but do not add a child to it. The expander widget has an Gtk.Expander.Gtk_Expander:expanded property which can be used to monitor its expansion state. You should watch this property with a signal connection as follows: <programlisting id="expander-callback-example"> 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 */ } } </programlisting> == 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. == A UI definition fragment with GtkExpander == <object class="GtkExpander"> <child type="label"> <object class="GtkLabel" id="expander-label"/> </child> <child> <object class="GtkEntry" id="expander-content"/> </child> </object>