GtkExpander Constructor

GtkExpander (string label);

Creates a new expander object using the parameter as the text of the label. The example below illustrates the usage of the constructor.

Example 62. Using Expander to Show/Hide details GtkExpander

//Creating the callbacks for handling basic window functions
function onDestroy()

//Creating and initialising a new window to add our expander to
$window = new GtkWindow();
$window->connect('destroy', 'onDestroy');
$window->set_title('GtkExpander Demo');
$window->set_default_size(250, 60);

//Creating a new expander object
$expander = new GtkExpander('Expander');

//Creating a label to store details
$label = new GtkLabel('Details can be shown or hidden');

//Adding the details to the expander

//Adding the expander to the window

//Displaying the window and starting the main loop