Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Tkinter and Widget

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


dvaken at hotmail

Sep 12, 2001, 5:25 AM

Post #1 of 2 (188 views)
Permalink
Tkinter and Widget

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


johnmc at velseis

Sep 12, 2001, 4:21 PM

Post #2 of 2 (159 views)
Permalink
Tkinter and Widget [In reply to]

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
>
>
>

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.