widget is a term used in the world of X for any user interface. A widget can be a text box, label, frame, window or any other GUI component. GTK widgets are all derived from the abstract base class GtkWidget, and inherit the methods, signals and properties implemented therein.
From a programming point of view a widget has five parts to its life cycle:
Creation
In PHP-GTK this is done by creating an object, e.g. $window = &new GtkWindow();
Placement
This is the step of adding a widget to a container. This is achieved most straightforwardly in PHP-GTK by using the syntax $container->add($widget);
Signal Connection
This is the step of setting up callback functions for use. An example of this might be $widget->connect("event", "my_focus_func"); , where "event" is a predefined state such as "clicked" and "my_focus_func" is the called subroutine.
Display
This describes whether the widget is on display to the user. It is started by calling $widget->show(); and finished by $widget->hide();.
Destruction
This occurs when the gtk::main_quit() function is called. All actions that are necessary here are handled internally.