Re: GtkWindow set_focus() method
| From: | Gonzalo Monzón | Date: | Thu, 09 Sep 2004 18:40:32 +0000 |
| Subject: | Re: GtkWindow set_focus() method | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5061@lists.php.net to get a copy of this message | ||
Gonzalo Monzón escribió:
Hi guys! I hope somebody could drop me a line... I'm working in some win32 php-gtk apps, and now I'm turning around my app's window management so a window wich maybe is minimized or just in second plane would get on top as the user presses a menu option once that window was yet opened before... Some time ago I made some tests but they were all unsuccesfull, i'd like to hear from somebody who could drop me a hand and I expect this is possible with actual version of php-gtk, maybe not... Maybe this would be made doing some interaction with the os desktop manager, and I question myself about if in win32 the way should be to do some hacking with the win32apis? ... Calling set_focus method for the window doesn't seem to do nothing in this case... and I don't know anymore methods to do this using gtk objects... maybe I'm wrong? Thank you in advance, Gonzalo Monzon Sorry to all, now I realized my doc was not the last release, so I seesome win32api calls to do the job at this url: http://gtk.php.net/manual/en/gtk.gtkwindow.php /////////////////////// dl("php_w32api.dll"); $api =& new win32; 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"); $window =& new GtkWindow(); $window->set_title('PHP Test'); $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); } ////////////////////// Gonzalo Monzon