From: Andy S. <laz...@gm...> - 2010-07-31 12:25:37
|
Hi Hamish, Hamish Mackenzie <ham...@go...> writes: > GDK supports two different types of native window ID, pointers and ints (GDK_NATIVE_WINDOW_POINTER > indicates if pointers are used). On windows the closest thing to a X11 window ID a HWND is a void > *, so GDK used a pointer (yes windows have IDs too but they are really just a user property). > > The code in Graphics.UI.Gtk.General.Structs already seems to be set up to handle both cases. > NativeWindowID can have two different types depending on GDK_NATIVE_WINDOW_POINTER. > > The sample code you sent me to test on windows assumed the native ID would be an integer.... > http://paste2.org/get/932932 > > By changing > putStrLn $ "GdkWindow Id : " ++ show (wid :: Int) > to > putStrLn $ "GdkWindow Id : " ++ show wid > > I get the output like this... > $ ./test.exe > GdkWindow Id : 0x000404dc > I have checked the value (using Microsoft Spy++) and it is indeed the correct HWND for window value. Cool, thanks for your help. Axel, my last patch for drawableGetID is correct, works fine on both UNIX and Windows. Maybe we can remove this function until GTK+-3 provide similar API. Cheers, -- Andy |