From: aakhter@... (Aamer Akhter) Date: 2003-10-05T06:56:12+09:00 Subject: Re: tcltklib and not init'ing tk Hidetoshi NAGAI wrote in message news:<20031005.015546.74755857.nagai@dumbo.ai.kyutech.ac.jp>... > Hi, > > Maybe this reply mail is too late. > # Sorry, but I was out on business trip. Hidetoshi, Thank-you for responding. It seems like these changes were in r1.39 of tcltklib.c, while 1.38 was the version released with with 1.8.0. I should have checked the CVS. > > 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. I would suggest not using the argv parameter space for indicating the non-desire for Tk. One might one to pass command line arguments to tclsh ( in the same way as to wish) > > 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'. While I'm not an active user of vwait, tkwait and espically not threads as they're not supported in tcl-expect, I think the TKinter python library has worked around these type of issues see: Modules/_tkinter.c in the regular python distribution I would like to work with yon on improving the transferability of lists and arrays between tcl and ruby, if you are interisted.