I am using Wing to write and debug a Tkinter GUI. I am finding that the Stack Data View doesn't seem to match the actual attributes of my widgets. Take this code for example:
import Tkinter
import ttk
root = Tkinter.Tk()
checkbutton = ttk.Checkbutton(root, text="Test Check Button")
print checkbutton.text
This gives me an attribute error at the last line. However, when I look at the stack, there is clearly an attribute called 'text' with the value that I'm looking for:
Anyone know what's going on?
I'm using:
I posted this to the Wing email list, and I got the following response from the developers:
It looks like a
ttk.Checkbutton
defineskeys()
and__getitem__()
methods to exposes tk attributes viacheckbutton[<name>]
. Because of thekeys()
and__getitem__()
, Wing is displaying the instance as if it were a dictionary, with the keys and values interspersed with the attributes. Wing does this because often you want to view an object that defineskeys()
and__getitem__()
as if it were a dictionary, but I agree that it's confusing in this instance.We'll try to improve this in a future release.