Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Does SWT (in Eclipse 3.2 or w.4) support embedding of GTK widgets inside the SWT widgets?


I'm not sure this "works".  Your code may end up making one window appear in another but that's about it.  The right way to embed on Windows is to use OLE.

On GTK, the right way to embed one X window in another is to use XEMBED, which is supported by GTK and therefore SWT.  Both sides implement this protocol which covers things like focus, tabbing etc.

If you just have the handle to a widget and expect to slap it into another widget hierarchy (like the sample Windows code), you could reach through to X windows on both sides and call XReparentWindow().  I have no idea whether it would work, but it would be equivalent to what you are doing on Windows.



"Dharmesh Bhakta" <bhaktadn@xxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

06/12/2008 03:16 PM

Please respond to
"Eclipse Platform SWT component developers list."        <platform-swt-dev@xxxxxxxxxxx>

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] Does SWT (in Eclipse 3.2 or w.4) support        embedding of GTK widgets inside the SWT widgets?





Does SWT (in Eclipse 3.2 or w.4) support embedding of GTK widgets
inside the SWT widgets? I can embed Windows based widgets inside the
SWT in the following manner and it seems to just work fine. But I
would like to embed a Linux GTK based native window inside the SWT.
How do I do it?

       nativeComposite = new Composite(parent, SWT.EMBEDDED );

       TCHAR  tChrTitle = new TCHAR(0,"Notepad - Untitled",true);

       handle = os.FindWindow(null, tChrTitle);

       os.SetWindowLong(handle, OS.GWL_STYLE, OS.WS_VISIBLE |
OS.WS_CLIPCHILDREN | OS.WS_CLIPSIBLINGS);

       os.SetParent(handle,nativeComposite.handle);

- Dan
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top