From: Jim I. <ji...@ap...> - 2001-11-07 19:38:56
|
Benjamin, First off, Tcl/Tk is not designed to allow you to load two independent copies of Tk into an application. There is global state in the libraries that will cause conflicts. So you have to make sure that you unload the first copy completely before you try to load the second copy. You can create two tcl interpreters, both running Tk, but the way you are supposed to do that is to create one interpreter, and then load Tk into the second interpreter by running "package require Tk" in the second interpreter. This is, for example, how the console window in MacTk works. But we never intended you to be able to actually load the Tk library twice. Theoretically, you could load Tk, then unload it. However, I never worked very hard to make sure that you could unload Tcl/Tk from an app, and then reload it again cleanly. There are finalization routines for all the subsystems, but I would have no problem believing they don't clean up everything. The only things I really cared about was non-shared state, and resources that the system would not reap when the process exited. You could probably fix this - since the mechanism to handle finalization is present. Hope this helps. Jim On Wednesday, November 7, 2001, at 08:28 AM, Schollnick, Benjamin wrote: > Slight apologies... > > As soon as I posted that previous message, I almost figured the > issue out. > Instead, I realized I had fallen for a Red Herring (Tm). > > Is there any reason that two Tcl/Tk initializations would be a > problem > on the Macintosh? > > The core of the issue is that I had initialized Tk/Tcl, and then > the Wizard package attempted to Initialize Tk/Tcl again... > Which caused the panic message... > > So, I have a better definition of the issue, but still suspect it's > a > Tcl Library issue? Can anyone confirm this? > > - Benjamin > > -----Original Message----- > From: Schollnick, Benjamin > Sent: Wednesday, November 07, 2001 11:16 AM > To: 'tc...@li...' > Subject: Problems with Mac TCL? > > Folks, > > Even though I'm using Tcl via Python, it appears this maybe > an implementation issue from Tcl... > > Now, please keep in mind that by no means am I huge > Tkinter/Tcl guru, > I'm not.... > > But never the less, here's what I'm seeing... > > "Menu ID 256 is already in use! Fatal Python Error: > Tcl/Tk Panic" > > Which from my investigation, means that Tcl/TK has > panicked...The Menu ID > appears also to be hardcoded somewhere? Presumably from > Tcl/Tk? > > The pseudo code is as follows: > > * Initialize Tk > * Create RootWindow object > * Withdraw the Tk TopWindow > * Display AskYesNo dialog > (If Yes) * display FileOpen Dialog > > * Start "Wizard" (Which also appears to Withdraw the > Tk TopWindow) > > Wizard is a python based MS Windows look-alike Wizard GUI > package... > > If I don't withdraw the Tk Top Window, everything appears to > work fine... > > If I do withdraw the Tk Top Window, I get the panic > message.... > I'm stumped, I've spoken to people in the Python groups > (lists & usenet), > with little luck... As I mentioned it appears to potentially > be a Tk/Tcl issue... > > Any suggestions for investigation? > > My first guess is that the dual TopWindow Withdraws maybe a > issue but > I'm not sure.... > > - Benjamin > > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac > -- Jim Ingham ji...@ap... Developer Tools - gdb Apple Computer |