note 448 added to gtk.gtkdialog.php

From: Date: Fri, 20 Aug 2004 16:40:55 +0000
Subject: note 448 added to gtk.gtkdialog.php
Groups: php.gtk.webmaster 
Request: Send a blank email to php-gtk-webmaster+get-2579@lists.php.net to get a copy of this message
Here is an example of how to use GtkDialog, and nested calls to Gtk::main(), to create, say, a Login window for an application. <?php dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : "so")); function quit_routine($dialog) { global $windowOneClosed; $windowOneClosed = TRUE; gtk::main_quit(); $dialog->destroy(); } function quit_routine2($window) { gtk::main_quit(); } $windowOneClosed = FALSE; $dialog = &new GtkDialog(); $dialog->set_policy(true, false, false); $dialog->set_position(GTK_WIN_POS_CENTER); $dialog->set_title("Dialog Window"); $dialog->connect("destroy", "quit_routine"); $dialog->show(); $dialog_vbox = $dialog->vbox; $dialog_action_area = $dialog->action_area; $user_info_label = &new GtkLabel("Some Important Information"); $dialog_vbox->pack_start($user_info_label); $user_info_label->show(); $ok_button = &new GtkButton("OK"); $dialog_action_area->pack_start($ok_button); $ok_button->connect_object("clicked", "quit_routine", $dialog); $ok_button->show(); gtk::main(); if($windowOneClosed) { $window2 = &new GtkWindow(); $window2->set_title("Quit Window"); $window2->connect("destroy", "quit_routine2"); $window2->show(); gtk::main(); } ?> http://gtk.php.net:80/manual/en/gtk.gtkdialog.php

« previous php.gtk.webmaster (#2579) next »