[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?
|
- From: "Dharmesh Bhakta" <bhaktadn@xxxxxxxxx>
- Date: Thu, 12 Jun 2008 18:56:41 -0500
- Delivered-to: platform-swt-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=mAKbyrlaPEDLzYoAsjDE32hgPza3vaz/1CzcSVbGi0M=; b=JupuosA3WvZvdXs6feDl0nNGAYRKEqd+CtTQzzmmngegFtvSgb3Y8jeJbPV7HipjOe UvGiw6IIRuXAm6Yncz68SMLOgSv/DILvhApy+Akeo/PrjnRRw6i3Ne824M1kjMD33W0r ZZLS5UApOhYnPXkZZqo+miRlT+1EGcNP/8MkY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Z7aqlx8FLWJznaycsN5EY8Xv0G9aknvm6xg2Iso/PROHPfhbkNXZJz8g8UBQ5ikPH9 j3crLtR0hOdkd3xzWkmz+1sFN7E9dnlFf/EuIeLxR62ZPrCY/ti2F8vBIYHm+te/bkR0 OF7oIREG31VbH0Qsmkkj2htMegOIA+7r3wgdo=
Thanks Steve for the quick response. Let me admit this first, I am a
newbie to both SWT and GTK so I am not familiar with all the concepts
around it but trying to learn as fast as i can.
Yes, That's exactly I want. I would like to make one window appear
inside the another. Let's say I have a simple native application,
gnaome-calculator. I would like the gnome-calculator to appear inside
a view under eclipse. For now, I'm just trying the gnome-calculator as
an example. But If I can get this to work, I should be able to get
other native business applications to work under eclipse.
I was hoping that the OS.gtk_widget_reparent(widget, parent) would
have given me the same results as I got on Windows. But it somehow did
not work as expected.
So, I did a little investigation on the GtkPlug & GtkSocket which uses
the XEMBED protocol. Doing deeper investigation on the SWT's side and
it appears that the nativeComposite.embeddedHandle is the socket_id
where I would like the gnome-calculator to appear. So now, I created a
new Gtk Plug using the OS.gtk_plug_new passing the socket_id of the
nativeComposite.embeddedHandle as the parameter.
This method returns a reference to the plug widget. I have been
successful in adding a new GTK widget to this plug widget and display
it inside an Eclipse view. :-) But I've been able to add a Window to
the plug widget. Any suggestions?
So now, the issue I will have here is how do I add the
gnome-calculator to the plug widget so I can display inside the
Eclipse Vieww. The only information I have for now is the X Window id
for the ganome-caculator. Some now I need to find a way to get the
widget representation of X Window id. Any suggestion here?
THanks in advance for your help.
- Dharmesh
Thanks in
On Thu, Jun 12, 2008 at 3:06 PM, Steve Northover
<Steve_Northover@xxxxxxxxxx> wrote:
>
> 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
>
>
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
>
>