Problems with Pmw

Mark Rivers rivers at cars.uchicago.edu
Sun Jun 23 20:35:33 EDT 2002


Folks,

In a previous post I mistakenly attributed one problem to Pmw.Blt, while
subsequent testing has shown that the problem has nothing to do with Blt, it
is a problem (?) with Pmw.

The problem is illustrated by the following short script:
########################################
from Tkinter import *
import Pmw
t1 = Tk()
t2 = Tk()
l = Label(t2, text='A label'); l.pack()
b = Button(t2, text='Press me'); b.pack()
e = Pmw.EntryField(t2, labelpos=W, label_text='Enter something'); e.pack()
########################################

Executing this script as shown results in the first Tk() window (t1) being
created, and the second Tk() window (t2) and the Label and Button widgets
being created, and then the following error when creating the
Pmw.EntryField:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "testBlt2.py", line 7, in ?
    e = Pmw.EntryField(t2, labelpos=W, label_text='Enter something');
e.pack()
  File "C:\PROGRA~1\Python21\Pmw\Pmw_0_8_5\lib\PmwEntryField.py", line 72,
in __
init__
    sequences = root.bind_class(tag)
  File "C:\PROGRA~1\Python21\lib\lib-tk\Tkinter.py", line 923, in bind_class
    return self._bind(('bind', className), sequence, func, add, 0)
  File "C:\PROGRA~1\Python21\lib\lib-tk\Tkinter.py", line 858, in _bind
    return self.tk.splitlist(self.tk.call(what))
TclError: bad window path name ".15422476.15422044"

If the line "t1 = Tk()" is commented out then it works fine.

This happens both on Win32 and Linux with Python 2.1, and Pmw 0.8.5.

I think it should be legal to create multiple Tk() windows in an
application, so this seems like a serious bug?

Thanks,

              Mark Rivers
              Dept. of Geophysical Sciences, University of Chicago
              GSECARS, Advanced Photon Source, Argonne National Laboratory






More information about the Python-list mailing list