Prev: NC-Sim Tcl script tool?
Next: Expect in a shell pipe
From: Don Porter on 31 Aug 2006 13:34 antred wrote: > Okay, I'm working around my last prolblem by using a Tcl_Eval call to > source auto.tcl as well and it works. Now I have a new problem. > > The following sample is supposed to display a window saying "hello > world": > > label .hello -text "Hello World" > pack .hello > > Unfortunately it does not. The interpreter executes the commands and > then ends. No window is ever shown. =( Your program is probably failing to start an event loop. Can you go back several steps and just consider dynamically loading Tk in the usual way with package require Tk ?
From: David Gravereaux on 1 Sep 2006 14:53 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 antred wrote: > 1) call Tcl_CreateInterp() > 2) Tcl_FindExecutable() > 3) Tcl_Init() > 4) Tk_Init() > 5) done ?? > 6) Tcl_Eval( whatever_script_the_user_is_running ) 7) churn the event loop until asked to exit. I have more to say, but I'm off to "make the donuts" right now. - -- David Gravereaux <davygrvy(a)pobox.com> [species:human; planet:earth,milkyway(western spiral arm),alpha sector] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFE+IHClZadkQh/RmERAkZbAKDApQIQh1iFy4C6Z99EiGUT9GiVbACgiujv YD9gWYRf3++gvKVOJMOTMaA= =YGXK -----END PGP SIGNATURE-----
From: antred on 26 Sep 2006 05:00
Hello guys, First off, thanks for your replies. With your help, I've solved most (well, some) of the problems I've mentioned and I now almost have this thing running. Just one final problem remains. David Gravereaux wrote: > > 7) churn the event loop until asked to exit. > Do you have any idea how I would go about this? Previously, my MFC application went about processing a Tcl script by passing the pathname of the script to Tcl_EvalFile() ... which won't return until the script is done. To fire up the event loop of Tk, I'd have to call Tk_MainLoop() ... which never returns until the user closes the last Tk window. I guess the problem is that I'm essentially trying to combine a sequential, synchronous execution mechanism (Tcl_EvalFile()) with an event drive execution mechanism (Tk_MainLoop()) ... and I have no idea how to do it. Perhaps it isn't even possible in the way I've dreamed it up. =( |