From: Hidetoshi NAGAI Date: 2003-10-05T01:55:50+09:00 Subject: Re: tcltklib and not init'ing tk Hi, Maybe this reply mail is too late. # Sorry, but I was out on business trip. From: aakhter@cisco.com (Aamer Akhter) Subject: tcltklib and not init'ing tk Date: Wed, 1 Oct 2003 15:20:05 +0900 Message-ID: <3a7be850.0309302200.61ec47be@posting.google.com> > 1) is there a way to _not_ start tk? When I create a new interpreter > (let's say from a non X-fwded ssh session) it may cause a failure. I'm > only interested in Tcl. from ChangeLog of CVS Head, ---------------------------------------------- Fri Aug 29 17:30:15 2003 Hidetoshi NAGAI (snip) * ext/tcltklib/tcltklib.c : can create a interpreter without Tk ---------------------------------------------- Please create a Tcl interpreter by TclTkIp.new(ip_name, nil). 'ip_name' is the name of the interpreter which is shown with 'winfo interps' and so on. Usually, 2nd argument of TclTkIp.new method is given command line options of 'wish' (e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') ). But if given nil or false, the interpreter starts without Tk. Unfortunately, tk.rb doesn't work with the interpreter without initialized Tk library. Therefore you must call TclTkIp#invoke or TclTkIp#eval. If you want to wrap the control script using such methods by Ruby's classes or modules, please refer TkCore or TkComm moduless on tk.rb. They may help you. BTW, there is a known bug on tcltklib.c. It causes 'Segmentation Fault' when 'vwait' or 'tkwait' command is called on the other thread than 'mainloop' thread. Those commands call Tcl_DoOneEvent() function. And it conflicts with the eventloop control of tcltklib.c. I've been working on fixing the problem. I think I must implement the routines to replace 'vwait' and 'tkwait'. -- Hidetoshi Nagai (nagai@ai.kyutech.ac.jp)