Ich habe irgendwie ein kleines Problemchen mit dem Tkinter-Listbox-Widget: folgender ...
Code: Alles auswählen
from Tkinter import *
class TestBox:
def __init__(self, master):
self.lb = Listbox(master, selectmode=SINGLE)
for a in range(10):
self.lb.insert(END, str(a))
self.lb.pack()
self.lb.bind('<Double-Button-1>', self.doSomething)
def doSomething(self, event):
auswahl = self.lb.curselection()[0]
print self.lb.get(auswahl)
if __name__=="__main__":
root = Tk()
testbox = TestBox(root)
root.mainloop()
Exception in Tkinter callback
Traceback (most recent call last):
File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/lib-tk/Tkinter.py", line 1299, in __call__
args = apply(self.subst, args)
File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/lib-tk/Tkinter.py", line 1035, in _substitute
e.height = getint(h)
ValueError: invalid literal for int(): ??
Kennt das jemand?
Wo liegt mein Problem???
Ganz vielen Dank im voraus
Jochen