
johnmc at velseis
Sep 12, 2001, 4:21 PM
Post #2 of 2
(159 views)
Permalink
|
Try this: from Tkinter import * root = Tk() b = Button(root, text='test') b.keys() This returns the following list of all the available options for the Button widget. [.'activebackground', 'activeforeground', 'anchor', 'background', 'bd', 'bg', 'bitmap', 'borderwidth', 'command', 'cursor', 'default', 'disabledforeground', 'fg', 'font', 'foreground', 'height', 'highlightbackground', 'highlightcolor', 'highlightthickness', 'image', 'justify', 'padx', 'pady', 'relief', 'state', 'takefocus', 'text', 'textvariable', 'underline', 'width', 'wraplength'] John McMonagle Golem wrote: > Hi all ! > I would like to know if there's a way to list all options that can be set > for a widget ? > In the Fredrik Lundh's Introduction To Tkinter, he says that we can use : > keys() => list of all options available for this widget > I think that "keys" represent the widget (button, label) > So i try : > > Mylist = Button() > for i in Mylist > print i > > But it doesn't work > > How can we do that ? > > Thkx > > Golem > > >
|