Example

From: Date: Mon, 28 Aug 2006 19:08:36 +0000
Subject: Example
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7125@lists.php.net to get a copy of this message
Hi Suomaf Sure <?php if (!class_exists('gtk')) {
       die('Please load the php-gtk2 module in your php.ini' . "\r\n");
} include ("classes/dialogs.php"); include ("inifile.php"); include ("login.php"); $janelas = array(); $status = new GtkStatusbar(); $notebook_pages = 0; function delete_event() {
       return false;
} function shutdown() {
       gtk::main_quit();
} function update_status($msg) {
           global $status;                    $status->push(0,"$msg");
       }
  
function main_workspace () { //main window here global $janelas, $status, $notebook_pages; $ini = new IniFile("config.ini"); $modinst = $ini->getValue("CORE_COREMODULES","modinst"); $window = new GtkWindow(); $window->set_title("Core System"); $window->set_position(GTK_WIN_POS_CENTER); $window->set_default_size(800, 600); $vbox = &new GtkVBox(false,1); $vbox->pack_start($menuBar, false, false, 0); $vbox->pack_start($notebook, true, false, 1); //barra de estado $vbox->pack_start($status, false, false, 0); $window->add($vbox); $window->show_all(); $window->connect_object('destroy','shutdown'); } //this calls the login procedures on the login.php file when starting the program //after the login procedure call main_workspace() $login = new login(); if ($login == true) { main_workspace(); } gtk::main(); ?> This should give you push. This may not be the best way so you should do more research on this. I'm using PHP GTK for a while myself, but I am also pretty newb a this too. Happy coding ( and debugging ) Regards

« previous php.gtk.general (#7125) next »