Scripting an Xlib GUI using Tcl Without Tk 
Author Message
 Scripting an Xlib GUI using Tcl Without Tk

I'm writing an interpreter that converts a Tcl script to Xlib function
calls.  I have two problems.  

My first problem:

<Tcl>
display dis

<Xlib>
Display *dis;

How can I translate that declaration?  If it is not possible to
translate what is a better method?  I also want to do the same thing
with the Xlib Window declaration, so if that would take anything special
please tell me.

Problem Two:
<Tcl>
win my_win {

button 10 10 20 20
drawline 10 20 100 20

           }

Basically I want all of the things between the curly braces of the
window my_win to belong to that window.  Hence using button
.toplevel.widget would not be needed, instead win my_win {widgets} would
be used.

<Xlib>
Tcl_CreateObjCommand (interp, "drawline", drawline_cmd, (ClientData)
NULL, (Tcl_CmdDeleteProc *) NULL);

drawline_cmd (ClientData client_data, Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[])
{
int first_x, first_y, second_x, second_y;

Tcl_GetIntFromObj (interp, objv[1], &first_x);
Tcl_GetIntFromObj (interp, objv[2], &first_y);
Tcl_GetIntFromObj (interp, objv[3], &second_x);
Tcl_GetIntFromObj (interp, objv[4], &second_y);
XDrawLine (dis, win, font_gc, first_x, first_y, second_x, second_y);

return TCL_OK;

Quote:
}

How can I parse the win command so that the data between the curly
braces in the Tcl script uses the window my_win.  

I realize that this is a little weird.  I am doing this mostly to learn
how things work.  I have been studying the Tk source code for answers to
my problems, but I must confess that I don't understand most of it.

Thanks for any help.
--
----------------------------------
George Peter Staplin
http://www.*-*-*.com/ ~georgeps/
----------------------------------



Wed, 04 Dec 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. conversion Tcl/Tk (with GUI) to Tcl (without GUI)

2. Tcl/Tk Canvas With Xlib JPEG Display Without Img

3. ANNOUNCE: Using Xlib With Tcl/Tk Tutorial

4. Using Xlib drawing inside Tcl/Tk 8.0 on Windows Platform

5. Xlib problems using tcl/tk

6. Embeding a TCl/Tk program in an application using Xlib

7. HELP -xlib error using TCL/TK

8. Running a TK script using wish80.exe within a tcl script

9. Need example of working tcl/tk script used as cgi-bin script

10. - Tcl without windows, Tcl without Tk for windows.

11. Tcl/Tk without script

12. TK using in other languages without TCL

 

 
Powered by phpBB® Forum Software