xid on windows32

From: Date: Sun, 12 Dec 2004 04:55:26 +0000
Subject: xid on windows32
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5336@lists.php.net to get a copy of this message
Hi Here is a patch to enable finding the hwnd for a gtkWindow on a windows32 box. --- php_gtk+_types.c 7 Aug 2004 06:49:34 -0000 1.25.4.2 +++ php_gtk+_types.c 12 Dec 2004 04:45:08 -0000 @@ -25,6 +25,8 @@ #if HAVE_PHP_GTK #ifndef PHP_WIN32 #include <gdk/gdkx.h> +#else +#include "win32/gdkwin32.h" #endif int le_php_gtk_wrapper; @@ -768,12 +770,9 @@ gdk_window_get_geometry(win, NULL, NULL, NULL, NULL, &x); RETURN_LONG(x); } -#ifndef PHP_WIN32 else if (!strcmp(prop_name, "xid")) { - RETURN_LONG(GDK_WINDOW_XWINDOW(win)); + RETURN_LONG((long) GDK_WINDOW_XWINDOW(win)); } -#endif - if (Z_OBJCE_P(object) == gdk_window_ce) { if (!strcmp(prop_name, "x")) { gdk_window_get_position(win, &x, NULL); Usage is <?php $window =& new GtkWindow(); $window->show(); $win = $window->window; echo 'HWND:'.$win->xid."\n"; . . //and for the children: $wkids = $win->children; foreach($wkids as $w){ echo 'kwin HWND:'.($w->xid)."\n"; } -- Tom

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