PHP-GTK - Example

Example

set_title('Hello World!'); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $button->connect_simple('clicked', 'pressed'); $window->add($button); $window->show_all; Gtk::main; ?>

The sample PHP-GTK 2 program instantiates a GtkWindow widget with the title "Hello World!", containing a GtkButton labelled "Click Me." When the button is pressed, the message "Hello again - The button was pressed!" is displayed on the console via the callback pressed.

Read more about this topic:  PHP-GTK

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)