tkSimpleDialog fails

Gheorghe Postelnicu gheorghe.postelnicu at gmail.com
Thu Aug 31 13:52:42 EDT 2006


Hi,

I am using Python to develop a front-end GUI using Tk. I would need to
use some of the tkSimpleDialog widgets, but they seem to fail. As far
as I could tell, this happens because my application also uses VTK, so
I have to use the root.withdraw() line

root = Tkinter.Tk()
root.withdraw()

app = Application(root,700,700)

root.mainloop()


Hence, when I call tkSimpleDialog.askfloat, here's what I get:


Traceback (most recent call last):
  File "pyScout.py", line 426, in SelectRegion
    spacing = tkSimpleDialog.askfloat("Profile spacing","Input spacing
value")
  File "/usr/lib64/python2.3/lib-tk/tkSimpleDialog.py", line 271, in askfloat
    d = _QueryFloat(title, prompt, **kw)
  File "/usr/lib64/python2.3/lib-tk/tkSimpleDialog.py", line 179, in __init__
    Dialog.__init__(self, parent, title)
  File "/usr/lib64/python2.3/lib-tk/tkSimpleDialog.py", line 64, in __init__
    self.grab_set()
  File "/usr/lib64/python2.3/lib-tk/Tkinter.py", line 521, in grab_set
    self.tk.call('grab', 'set', self._w)
_tkinter.TclError: grab failed: window not viewable


Thanks,
-- 
Gheorghe Postelnicu, PhD
MGH, Harvard Medical School



More information about the Python-list mailing list