RE: [PHP-GTK] maximize window

From: Date: Tue, 20 Jul 2004 06:09:04 +0000
Subject: RE: [PHP-GTK] maximize window
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4802@lists.php.net to get a copy of this message
nice one Tom :) Please can you add that to the wiki? > -----Original Message----- > From: Tom Rogers [mailto:trogers@kwikin.com] > Sent: 20 July 2004 06:51 > To: Wim Stockman > Cc: php-gtk-general@lists.php.net > Subject: Re: [PHP-GTK] maximize window > > > Hi, > > Saturday, July 17, 2004, 8:02:19 PM, you wrote: > WS> Hello, > > WS> I want to maximize my window from the code, but I can't find the > WS> function for it. > > $window->>set_usize(gdk::screen_width(),gdk::screen_height()); > WS> but this only sets the window size equal to maximize , it is not truly > WS> maximized. > > WS> Does anyone know? > WS> wim stockman > WS> Belgium > > I did some tinkering and for windows came up with this solution using > the win32api. If on unix maybe you can do something similar with > gdkwindow->xid which is not available under windows > > <?php > if (!extension_loaded('gtk')) { > dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); > dl("php_w32api.dll"); > } > //start windows api class > $api =& new win32; > //defines > define('SW_MAXIMIZE',3); > define('SW_MINIMIZE',6); > //register windows functions > $api->registerfunction("long GetLastError > Alias GetError () > From kernel32.dll"); > $api->registerfunction("long FindWindow > (string &ClassName, string &WindowName) > From user32.dll"); > $api->registerfunction("long ShowWindow > (long hWnd, long nCmdShow) > From user32.dll"); > //gtk shutdown function > function shutdown() { > Gtk::main_quit(); > } > //main window > $window =& new GtkWindow(); > $window->set_title('PHP Test'); > $window->set_policy(true, true, false); > $window->connect('destroy', 'shutdown'); > $window->show(); > $class_string = 'gdkWindowToplevel'; > $title_string = 'PHP Test'; > if(!$sw = $api->FindWindow($class_string,$title_string)){ > $error = $api->getError(); > echo ' Oops FindWindow error: '.$error."\n"; > }else{ > $api->ShowWindow($sw,SW_MAXIMIZE); > } > Gtk::main(); > ?> > > -- > regards, > Tom > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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