Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PHP-GTK
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Example == [[File:Hello World PHP-GTK.png|Hello World PHP-GTK|right]] <syntaxhighlight lang="php"> <?php function pressed() { echo "Hello again - The button was pressed!\n"; } $window = new GtkWindow(); $button = new GtkButton('Click'); $button1 = new GtkButton('Click'); $window->set_title('Hello World!'); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $button->connect_simple('clicked', 'pressed'); $button1->connect_simple('clicked', 'pressed'); $window->add($button); $window->show_all(); Gtk::main(); </syntaxhighlight> The sample PHP-GTK 2 program instantiates a <code>GtkWindow</code> widget with the title "Hello World!", containing a <code>GtkButton</code> labelled "Click Me." When the button is pressed, the message "Hello again - The button was pressed!" is displayed on the console via the [[Callback (computer programming)|callback]] <code>pressed</code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)