Displaying X11 on Tk 
Author Message
 Displaying X11 on Tk

Hi, I currently have a program which is written in python using Tk,
and also I have a program written in C/C++ which uses X11,  what I
want to do is in the C program rather than display to X11, I would
like to have it display on my Tk winddow...  I am thinking I probably
have to write a wrapper for the Xlib, so that it calls Tk functions,
but this can be a hassle.

if anyone knows about any package which may already exist, or maybe
another method of getting around this problem, I would greatly
appreciate it if you would email me.

thanks,
Navead



Tue, 22 Jun 2004 04:07:09 GMT  
 Displaying X11 on Tk

Quote:

> Hi, I currently have a program which is written in python using Tk,
> and also I have a program written in C/C++ which uses X11,  what I
> want to do is in the C program rather than display to X11, I would
> like to have it display on my Tk winddow...  I am thinking I probably
> have to write a wrapper for the Xlib, so that it calls Tk functions,
> but this can be a hassle.

Not at all. Create a Toplevel or Frame widget with the container=1
resource, then use winfo_id to find out the Window ID of the
window. Pass that ID to your C++ program, and give the Window ID to
XCreateWindow.

If you want to have it the other way around (i.e. Tk embedding itself
into some other application), create a Toplevel widget with the
use=WindowID resource.

HTH,
Martin



Tue, 22 Jun 2004 10:19:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Displaying X11 on Tk

2. Howto: _fast_ image display with Tk on X11.

3. TkColors: an X11 color display in Tk

4. Integrating Tk within a non-Tk X11 app

5. 16-bit X11 fonts not correctly displayed

6. Smalltalk Access to X11 Display*

7. Using TK to read/write to serial port, allowing stdout display and TK GUI control

8. Displaying Tk In Non-Tk Window

9. Tk: catch Magellan Spacemouse X11 events

10. Tk and options (Linux/X11)

11. Compile BLT for recent Tcl/Tk on MacOS X (X11)

12. Tk hangs when required twice on X11?

 

 
Powered by phpBB® Forum Software