2005-01-02 19:16:41 +00:00
|
|
|
/* Expander
|
|
|
|
*
|
|
|
|
* GtkExpander allows to provide additional content that is initially hidden.
|
|
|
|
* This is also known as "disclosure triangle".
|
|
|
|
*
|
|
|
|
*/
|
2004-12-03 22:21:44 +00:00
|
|
|
using System;
|
|
|
|
using Gtk;
|
|
|
|
|
2005-04-01 21:08:14 +00:00
|
|
|
namespace GtkDemo
|
2004-12-03 22:21:44 +00:00
|
|
|
{
|
2004-12-12 22:11:44 +00:00
|
|
|
[Demo ("Expander", "DemoExpander.cs")]
|
2004-12-03 22:21:44 +00:00
|
|
|
public class DemoExpander : Gtk.Dialog
|
|
|
|
{
|
|
|
|
public DemoExpander () : base ("Demo Expander", null, DialogFlags.DestroyWithParent)
|
|
|
|
{
|
2005-04-01 21:08:14 +00:00
|
|
|
Resizable = false;
|
|
|
|
|
2005-03-24 04:32:49 +00:00
|
|
|
VBox vbox = new VBox (false, 5);
|
|
|
|
this.VBox.PackStart (vbox, true, true, 0);
|
|
|
|
vbox.BorderWidth = 5;
|
2005-04-01 21:08:14 +00:00
|
|
|
|
2005-03-24 04:32:49 +00:00
|
|
|
vbox.PackStart (new Label ("Expander demo. Click on the triangle for details."), false, false, 0);
|
2004-12-03 22:21:44 +00:00
|
|
|
|
2005-03-24 04:32:49 +00:00
|
|
|
// Create the expander
|
2004-12-03 22:21:44 +00:00
|
|
|
Expander expander = new Expander ("Details");
|
|
|
|
expander.Add (new Label ("Details can be shown or hidden."));
|
2005-03-24 04:32:49 +00:00
|
|
|
vbox.PackStart (expander, false, false, 0);
|
2004-12-03 22:21:44 +00:00
|
|
|
|
2005-04-01 21:08:14 +00:00
|
|
|
AddButton (Stock.Close, ResponseType.Close);
|
2004-12-03 22:21:44 +00:00
|
|
|
|
2005-04-01 21:08:14 +00:00
|
|
|
ShowAll ();
|
|
|
|
Run ();
|
|
|
|
Destroy ();
|
2004-12-03 22:21:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|