
Dear Chimera Dev Team, I am writing a Chimera extension and I use the Pmw toolkit in my GUI. I had no problems testing it and it worked great until I decided to reinstall my OS (Windows 7). After that, I installed Chimera 1.5.3, imported my extension and didn't face any problems at first. But then, after closing the viewer and running it again, an error occured right after importing the extension's gui: Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> b=Pmw.EntryField(a,labelpos="w",label_text="asd") File "C:\Program Files (x86)\Chimera 1.5\bin\lib\site-packages\Pmw\Pmw_1_3\lib\PmwEntryField.py", line 73, in __init__ sequences = root.bind_class(tag) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 1012, in bind_class return self._bind(('bind', className), sequence, func, add, 0) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 947, in _bind return self.tk.splitlist(self.tk.call(what)) TclError: bad window path name ".94327912.94328912" I didn't change anything since the last succesful testing of my extension - something happened after closing Chimera for the first time, and I have no idea what it is. After that, I tried reinstalling Chimera, installing older versions - it's always the same story; everything works great on the first run, but after I close the viewer for the first time, I am not ever able to use Pmw anymore. The code that causes this error is simple: a=Tkinter.Tk() b=Pmw.EntryField(a,labelpos="w",labeltext="c") I tried to type the same thing in IDLE and I got the exact same error. Thank you for any help, best, Mateusz

We use Pmw.EntryField in chimera a lot, and are not seeing this error. And it is extremely strange that reinstalling Windows 7 caused this problem, but not unheard of -- in the past, particular versions of Adobe Acrobat would screw up Python. Nowadays, anti-virus programs are the most likely culprits. So could you clarify what you mean about "closing the viewer"? Is the viewer the chimera graphics window and you are quitting and restarting chimera? Or is the viewer part of your extension? If it is the former, then I am totally baffled. If it is the latter, then the likely explanation is that when you close your extension, something is not cleaned up properly, and so when you reimport it, you get your error. A workaround solution would be to never completely close it in the first place, so it wouldn't have to recreated when it is imported the second time. Most chimera dialogs are like this -- they are singletons and just withdraw when closed and are raised when reentered. See the code in CHIMERA/share/chimera/baseDialog.py for details. HTH, Greg On 08/28/2011 03:40 PM, Mateusz Dobrychłop wrote:
Dear Chimera Dev Team,
I am writing a Chimera extension and I use the Pmw toolkit in my GUI. I had no problems testing it and it worked great until I decided to reinstall my OS (Windows 7). After that, I installed Chimera 1.5.3, imported my extension and didn't face any problems at first. But then, after closing the viewer and running it again, an error occured right after importing the extension's gui:
Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> b=Pmw.EntryField(a,labelpos="w",label_text="asd") File "C:\Program Files (x86)\Chimera 1.5\bin\lib\site-packages\Pmw\Pmw_1_3\lib\PmwEntryField.py", line 73, in __init__ sequences = root.bind_class(tag) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 1012, in bind_class return self._bind(('bind', className), sequence, func, add, 0) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 947, in _bind return self.tk.splitlist(self.tk.call(what)) TclError: bad window path name ".94327912.94328912"
I didn't change anything since the last succesful testing of my extension - something happened after closing Chimera for the first time, and I have no idea what it is.
After that, I tried reinstalling Chimera, installing older versions - it's always the same story; everything works great on the first run, but after I close the viewer for the first time, I am not ever able to use Pmw anymore.
The code that causes this error is simple:
a=Tkinter.Tk() b=Pmw.EntryField(a,labelpos="w",labeltext="c")
I tried to type the same thing in IDLE and I got the exact same error.
Thank you for any help,
best,
Mateusz

Hi Mateusz, Can you provide a script? When I type the two lines of code you provided into IDLE ("label_text" instead of "labeltext" of course) I get no errors, neither the first nor the second time. That said, the error in the traceback you provided is indicative to me that you are creating an EntryField from a parent widget that has been destroyed. When you say "closing the viewer" are you talking about the GUI for your extension? Perhaps closing it destroys the widgets and you are somehow reusing some of them the second time? Also I would recommend making your dialog inherit from chimera.baseDialog.ModelessDialog. This will allow it (in 1.6 builds) to be tiled along with other dialogs and to be quickly brought to the front with the 1.6 Rapid Access "Active Dialogs" list. The "Extension- Specific User Interface" programmer's example (http://plato.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/index.html ) goes into detail as to how to use a ModelessDialog. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Aug 28, 2011, at 3:40 PM, Mateusz Dobrychłop wrote:
Dear Chimera Dev Team,
I am writing a Chimera extension and I use the Pmw toolkit in my GUI. I had no problems testing it and it worked great until I decided to reinstall my OS (Windows 7). After that, I installed Chimera 1.5.3, imported my extension and didn't face any problems at first. But then, after closing the viewer and running it again, an error occured right after importing the extension's gui:
Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> b=Pmw.EntryField(a,labelpos="w",label_text="asd") File "C:\Program Files (x86)\Chimera 1.5\bin\lib\site-packages\Pmw \Pmw_1_3\lib\PmwEntryField.py", line 73, in __init__ sequences = root.bind_class(tag) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk \Tkinter.py", line 1012, in bind_class return self._bind(('bind', className), sequence, func, add, 0) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk \Tkinter.py", line 947, in _bind return self.tk.splitlist(self.tk.call(what)) TclError: bad window path name ".94327912.94328912"
I didn't change anything since the last succesful testing of my extension - something happened after closing Chimera for the first time, and I have no idea what it is.
After that, I tried reinstalling Chimera, installing older versions - it's always the same story; everything works great on the first run, but after I close the viewer for the first time, I am not ever able to use Pmw anymore.
The code that causes this error is simple:
a=Tkinter.Tk() b=Pmw.EntryField(a,labelpos="w",labeltext="c")
I tried to type the same thing in IDLE and I got the exact same error.
Thank you for any help,
best,
Mateusz _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Hi Mateusz, I suspect your problem is that a = Tkinter.Tk() creates a toplevel window with its own Tcl interpreter. You don't want that since the Chimera Tcl interpreter won't know that window exists. You want to use the Tcl interpreter Chimera uses for all its windows. To do that use instead. a = Tkinter.Toplevel() As Greg and Eric suggested it would be better to have Chimera baseDialog.py make the dialog window for you. Tom Mateusz Dobrychłop wrote:
Dear Chimera Dev Team,
I am writing a Chimera extension and I use the Pmw toolkit in my GUI. I had no problems testing it and it worked great until I decided to reinstall my OS (Windows 7). After that, I installed Chimera 1.5.3, imported my extension and didn't face any problems at first. But then, after closing the viewer and running it again, an error occured right after importing the extension's gui:
Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> b=Pmw.EntryField(a,labelpos="w",label_text="asd") File "C:\Program Files (x86)\Chimera 1.5\bin\lib\site-packages\Pmw\Pmw_1_3\lib\PmwEntryField.py", line 73, in __init__ sequences = root.bind_class(tag) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 1012, in bind_class return self._bind(('bind', className), sequence, func, add, 0) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 947, in _bind return self.tk.splitlist(self.tk.call(what)) TclError: bad window path name ".94327912.94328912"
I didn't change anything since the last succesful testing of my extension - something happened after closing Chimera for the first time, and I have no idea what it is.
After that, I tried reinstalling Chimera, installing older versions - it's always the same story; everything works great on the first run, but after I close the viewer for the first time, I am not ever able to use Pmw anymore.
The code that causes this error is simple:
a=Tkinter.Tk() b=Pmw.EntryField(a,labelpos="w",labeltext="c")
I tried to type the same thing in IDLE and I got the exact same error.
Thank you for any help,
best,
Mateusz
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Hello, I apologize for the delayed response. Using Toplevel() instead of Tk() generates the same problem. Actually, the problem is that my code used to work perfectly before the system's reinstallation and after the first launch of Chimera. I somehow managed to make it work - but I have no idea why the line of code makes it work and, still, why it wasn't necessary before, but it is now: x=Pmw.EntryField() When this is typed before any other usage of Pmw toolkit, the whole rest just works. I really wonder why this is a solution, if you have any ideas what is happening, please let me know ;) Best, Mateusz W dniu 29 sierpnia 2011 20:42 użytkownik Tom Goddard <goddard@sonic.net>napisał:
Hi Mateusz,
I suspect your problem is that
a = Tkinter.Tk()
creates a toplevel window with its own Tcl interpreter. You don't want that since the Chimera Tcl interpreter won't know that window exists. You want to use the Tcl interpreter Chimera uses for all its windows. To do that use instead.
a = Tkinter.Toplevel()
As Greg and Eric suggested it would be better to have Chimera baseDialog.py make the dialog window for you.
Tom
Mateusz Dobrychłop wrote:
Dear Chimera Dev Team,
I am writing a Chimera extension and I use the Pmw toolkit in my GUI. I had no problems testing it and it worked great until I decided to reinstall my OS (Windows 7). After that, I installed Chimera 1.5.3, imported my extension and didn't face any problems at first. But then, after closing the viewer and running it again, an error occured right after importing the extension's gui:
Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> b=Pmw.EntryField(a,labelpos="w",label_text="asd") File "C:\Program Files (x86)\Chimera 1.5\bin\lib\site-packages\Pmw\Pmw_1_3\lib\PmwEntryField.py", line 73, in __init__ sequences = root.bind_class(tag) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 1012, in bind_class return self._bind(('bind', className), sequence, func, add, 0) File "C:\Program Files (x86)\Chimera 1.5\bin\lib\lib-tk\Tkinter.py", line 947, in _bind return self.tk.splitlist(self.tk.call(what)) TclError: bad window path name ".94327912.94328912"
I didn't change anything since the last succesful testing of my extension - something happened after closing Chimera for the first time, and I have no idea what it is.
After that, I tried reinstalling Chimera, installing older versions - it's always the same story; everything works great on the first run, but after I close the viewer for the first time, I am not ever able to use Pmw anymore.
The code that causes this error is simple:
a=Tkinter.Tk() b=Pmw.EntryField(a,labelpos="w",labeltext="c")
I tried to type the same thing in IDLE and I got the exact same error.
Thank you for any help,
best,
Mateusz
_______________________________________________ Chimera-dev mailing listChimera-dev@cgl.ucsf.eduhttp://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
participants (4)
-
Eric Pettersen
-
Greg Couch
-
Mateusz Dobrychłop
-
Tom Goddard