diff --git a/doc/ChangeLog b/doc/ChangeLog index 306107d9d..0dd7d47ae 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2004-12-05 John Luke + + * en/Gtk/Expander.xml: doc it + 2004-12-03 Dan Winship * en/Gtk/TextBuffer.xml: diff --git a/doc/en/Gtk/Expander.xml b/doc/en/Gtk/Expander.xml index 01f193e79..041a50e79 100644 --- a/doc/en/Gtk/Expander.xml +++ b/doc/en/Gtk/Expander.xml @@ -9,8 +9,105 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added - To be added + A container which can hide its child + + +A allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a . + + +Normally you use an expander as you would use any other descendant of ; you create the child widget and use to add it to the expander. When the expander is toggled, it will take care of showing and hiding the child automatically. + + + +using System; +using Gtk; + +class DemoExpander : Gtk.Window +{ + static void Main () + { + Application.Init (); + new DemoExpander (); + Application.Run (); + } + + DemoExpander () : base ("Demo Expander") + { + this.BorderWidth = 10; + this.DeleteEvent += new DeleteEventHandler (OnWindowDelete); + + VBox vbox = new VBox (); + vbox.PackStart (new Label ("Expander demo. Click on the triangle for details."), false, true, 3); + + Expander expander = new Expander ("Details"); + expander.Add (new Label ("Details can be shown or hidden.")); + vbox.PackStart (expander, false, true, 3); + + this.Add (vbox); + this.ShowAll (); + } + + void OnWindowDelete (object sender, DeleteEventArgs a) + { + Application.Quit (); + } +} + + + +Special Usage + + +There 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 but do not add a child to it. The expander widget has which can be used to monitor its expansion state. + + + +using System; +using Gtk; + +class DemoExpander : Gtk.Window +{ + static void Main () + { + Application.Init (); + new DemoExpander (); + Application.Run (); + } + + DemoExpander () : base ("Demo Expander") + { + this.BorderWidth = 10; + this.DeleteEvent += new DeleteEventHandler (OnWindowDelete); + + VBox vbox = new VBox (); + vbox.PackStart (new Label ("Expander demo. Click on the triangle for details."), false, true, 3); + + Expander expander = new Expander ("Details"); + expander.Activated += new EventHandler (OnExpanded); + vbox.PackStart (expander, false, true, 3); + + this.Add (vbox); + this.ShowAll (); + } + + void OnExpanded (object sender, EventArgs a) + { + Expander expander = sender as Expander; + if (expander.Child == null) + { + expander.Add (new Label ("Details can be shown or hidden.")); + expander.ShowAll (); + } + } + + void OnWindowDelete (object sender, DeleteEventArgs a) + { + Application.Quit (); + } +} + + + Gtk.Bin @@ -52,8 +149,8 @@ - To be added - To be added + Disposes the resources associated with the object. + @@ -64,8 +161,8 @@ - To be added - To be added + Default handler for the event. + Override this method in a subclass to provide a default handler for the event. @@ -76,10 +173,10 @@ - To be added + Internal constructor a a - To be added + @@ -90,10 +187,10 @@ - To be added + Internal constructor a a - To be added + @@ -104,10 +201,10 @@ - To be added + Creates a new expander with as its label. a a - To be added + @@ -118,9 +215,9 @@ - To be added + GType Property. a - To be added + Returns the native value for . @@ -131,9 +228,16 @@ - To be added + The text of the label of the expander. a - To be added + + +If the label text has not been set the return value will be . + + +Setting the label will also clear any previously set labels. + + @@ -144,9 +248,11 @@ - To be added - a - To be added + Whether the text of the label contains markup in Pango's text markup language. + a , if the label's text should be parsed for markup + + + @@ -157,9 +263,16 @@ - To be added + Space to put between the label and the child. a - To be added + + +Allowed values: >= 0 + + +Default value: 0 + + @@ -170,9 +283,9 @@ - To be added + The state of the expander. a - To be added + Returns if the child widget is revealed. @@ -183,9 +296,9 @@ - To be added - a - To be added + Whether an embedded underline in the expander label indicates a mnemonic. + a , if underlines in the text indicate mnemonics + @@ -196,9 +309,9 @@ - To be added - a - To be added + The label widget for the expander. + the label , or if there is none. + This is the widget that will appear embedded alongside the expander arrow. @@ -209,8 +322,8 @@ - To be added - To be added + Emitted when the expander is toggled. +