also zum problem:
der .trace produziert eine elllenlange fehlermeldung mit der ich als relativer neuling nichts anfangen kann.
die fehlermeldung:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python34\lib\tkinter\__init__.py", line 1533, in __call__
return self.func(*args)
File "C:\Python34\lib\tkinter\__init__.py", line 3308, in __call__
self.__var.set(self.__value)
File "C:\Python34\lib\tkinter\__init__.py", line 263, in set
return self._tk.globalsetvar(self._name, value)
_tkinter.TclError: can't set "PY_VAR0":
Traceback (most recent call last):
File "C:\Python34\lib\tkinter\__init__.py", line 1533, in __call__
return self.func(*args)
TypeError: 'NoneType' object is not callable
habe das ganze in einem testprog auf den .trace reduzieren können
hier das bischen prog
Code: Alles auswählen
from tkinter import *
OPTIONS = [
"egg",
"bunny",
"chicken"
]
master = Tk()
variable = StringVar(master)
variable.set(OPTIONS[0])
w = OptionMenu (master, variable, *OPTIONS)
w.pack()
def cb():
print("test")
variable.trace("w", cb())
mainloop()