Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Borrowing windows from other Tk applications

9 views
Skip to first unread message

Henning Schulzrinne

unread,
May 25, 1996, 3:00:00 AM5/25/96
to

How can an application (either Tk-based or just X) "borrow" a window
from another application? In particular, I want to have an X-based
(plain Xlib) application write a video image into a window prepared by
a Tk application.

Thanks.

Henning
Schulzrinne
--
Henning Schulzrinne email: schul...@fokus.gmd.de
GMD-Fokus phone: +49 30 25499 182
Hardenbergplatz 2 fax: +49 30 25499 202
D-10623 Berlin URL: http://www.fokus.gmd.de/step/hgs

Jacob Levy

unread,
May 25, 1996, 3:00:00 AM5/25/96
to

I think what you are referring to is a special case of embedding, where the
X application is using a window belonging to Tk. We are working on a general
solution to embedding that will allow Tk applications to embed other
applications (e.g. those written in pure Xlib or Windows) and will allow
those applications to embed Tk applications. This may materialize
in Tk 4.3.

--JYL

In article <4o7b2u$f...@lupus.fokus.gmd.de>, h...@fokus.gmd.de says...

Steve Ball

unread,
May 26, 1996, 3:00:00 AM5/26/96
to

h...@fokus.gmd.de (Henning Schulzrinne) writes:

>How can an application (either Tk-based or just X) "borrow" a window
>from another application? In particular, I want to have an X-based
>(plain Xlib) application write a video image into a window prepared by
>a Tk application.

You can pass the XID of the window to the Xlib application. The Tk
winfo command will give that to you, eg.

frame .my.video.widget -width 200 -height 200
set myID [winfo id .my.video.widget]
exec myApp -xid $myID

Needless to say, this won't be portable to other platforms...

Cheers,
Steve Ball

--
Steve Ball, PASTIME Project, ACSys CRC, ANU
E-mail: Steve...@pastime.anu.edu.au Ph. +61 6 2495146
Snail-mail: Canberra ACT 0200, AUSTRALIA
He's not the messiah, he's a very naughty boy!

Frederic BONNET

unread,
May 28, 1996, 3:00:00 AM5/28/96
to

Henning Schulzrinne wrote:
>
> How can an application (either Tk-based or just X) "borrow" a window
> from another application? In particular, I want to have an X-based
> (plain Xlib) application write a video image into a window prepared by
> a Tk application.

Hi Henning,

You can take a look at TkSteal. The purpose of this extension is to
"capture" the window of a X app in a Tk child window that can be packed
and whatsoever. I think that this should work fine in your case (Xlib
window embedded in a Tk app).

TkSteal should be available in many ftp sites. Just do an archie request
with "tksteal".

Regards ,

--
Frederic BONNET Eleve-Ingenieur de l'Ecole des Mines de Nantes
fbo...@irisa.fr Stagiaire IRISA - Projet Solidor

"Il ne faut jamais remettre au lendemain ce qu'on peut faire le surlendemain"
Oscar WILDE

David Wu

unread,
May 28, 1996, 3:00:00 AM5/28/96
to

: You can take a look at TkSteal. The purpose of this extension is to

: "capture" the window of a X app in a Tk child window that can be packed
: and whatsoever. I think that this should work fine in your case (Xlib
: window embedded in a Tk app).

I have a somewhat similar problem but I'd like to put a Tk widget inside
of a Motif app. Is there something similar to TkSteal, but "the other way
around"?

Dave.


Ken Hornstein

unread,
May 28, 1996, 3:00:00 AM5/28/96
to

In article <4ofehe$i...@agate.berkeley.edu>,

Get the window ID of the window (winfo id), then do a XReparentWindow()
on that window. That's the essential magic behind TkSteal, but there's
a lot of little details you have to watch over. Looking at the source code
for TkSteal will probably help.

--Ken

Ben Anderson

unread,
May 30, 1996, 3:00:00 AM5/30/96
to

> In article <4ofehe$i...@agate.berkeley.edu>,
> David Wu <dav...@plane.CS.Berkeley.EDU> wrote:
> >: You can take a look at TkSteal. The purpose of this extension is to
> >: "capture" the window of a X app in a Tk child window that can be packed
> >: and whatsoever. I think that this should work fine in your case (Xlib
> >: window embedded in a Tk app).
> >

anyone managed to get TkSteal to compile with a more recent version of tcl/tk?

cheers
Ben.
--
http://pipkin.lut.ac.uk/~ben/sig.html

0 new messages