function killwindow(&$window, &$class) { if ($class) { $class->quit(); } else { $window->destroy(); } gtk::main_quit(); }
function callback($data) { static $i = 0; if ($i < 1000) { $i++; echo "callback called\n"; return TRUE; } else { echo "callback finished, data was: {$data}\n"; gtk::main_quit(); } }
function shutdown() { print "Shutting down...\n"; gtk::main_quit(); }
function on_exit_clicked($button) { /* exit the main loop */ gtk::main_quit(); }
/** * Checks to see if the file has been saved before destroying the * main window. * * The user should save their file before the application closes. * If they have not, they will be prompted to save or close any * way. * * This method will also kill the main gtk loop if told to. If * this class is imbedded in another class, you probably don't * want to do that. Pass false to the constructor to prevent * this from happening. * * @param boolean $killMainLoop * @return void * @access public */ function checkBeforeQuit($killMainLoop) { // Check to see if the file was saved. if (!$this->saved) { // Prompt the user with a GtkDialog window. $dialog =& new GtkDialog(); $vBox = $dialog->vbox; $vBox->pack_start(new GtkLabel('Your package file has not been saved.' . ' Would you like to save it now?')); $dialog->show_all(); gtk::main(); } // Kill the main loop if requested. if ($killMainLoop) { return gtk::main_quit(); } else { return true; } }
function destroy($window) { gtk::main_quit(); }