Re: [gtk-win32] Object Handle



I have managed to successfully put a Windows .Net
System.Windows.Forms.Control into a Gtk# top level window. It wasn't
really that hard.

Basically I created a Gtk# widget, grabbed it's hWnd, the reparented the
WinForm control into it. It really wasn't hard. This works when using a
Gtk main loop as it draws from the Win32 message pump. For the reverse,
I'm not so sure.

I doubt the experience would be much different using Win32 instead
of .Net.

What is hard is getting layout to work, and propagating size changes to
the control in a meaningful manner.

On Tue, 2007-08-28 at 23:05 +0300, Tor Lillqvist wrote:
> lee designrealm co uk writes:
>  > I'd like to embed a control into a GTK window that accepts a Windows  
>  > native id as an HWnd for its placement. How do I aqcuire a windows  
>  > control handle from GTK 
> 
> I don't know what you mean with "control handle". You can get the
> *window* handle for a GDK window using the function
> gdk_win32_drawable_get_handle() that takes a GdkWindow* as
> parameter. Include <gdkwin32.h> to get the prototype:
> 
> /* Translate from drawable to Windows handle */
> HGDIOBJ       gdk_win32_drawable_get_handle (GdkDrawable *drawable);
> 
> But please note that it is questionable whether "embedding a control"
> into a GTK window will work. It will be much hairier than you expect.
> 
>  > and what control would be best used for adding the control.
> 
> What you really are asking is how to embed a widget or "control"
> written in another toolkit in a GTK+ widget? I have never done this. I
> think some people have managed to call the Windows file selector from
> GTK+. But that control has its own top-level window. I don't know if
> anybody have managed to embed a control in a GTK+ window.
> 
> --tml
> 
> _______________________________________________
> gtk-win32-list mailing list
> gtk-win32-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-win32-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]