468,168 Members | 1,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,168 developers. It's quick & easy.

tkinter: drop-down widget

Can anyone recommend some code for creating drop-down menus in tkinter?
To be absolutely clear, here's an example of a drop-down:

http://www.google.co.uk/preferences?hl=en
(see the language selection widget)

I've found the odd bit of code here and there, such as:
http://infohost.nmt.edu/tcc/cgi/pre....ng/dropdown.py

alex
Dec 15 '05 #1
4 13427
Alex Hunsley wrote:
Can anyone recommend some code for creating drop-down menus in tkinter?
To be absolutely clear, here's an example of a drop-down:

http://www.google.co.uk/preferences?hl=en
(see the language selection widget)

I've found the odd bit of code here and there, such as:
http://infohost.nmt.edu/tcc/cgi/pre....ng/dropdown.py


This seems to work ok, except it's a little rough around the edges (e.g.
the drop-down is a button with no visual affordance that it is a drop
down, the button changes size depending on what is selected, etc...)

thanks
alex
Dec 15 '05 #2
Alex Hunsley wrote:
Can anyone recommend some code for creating drop-down menus in tkinter?
To be absolutely clear, here's an example of a drop-down:

http://www.google.co.uk/preferences?hl=en
(see the language selection widget)

I've found the odd bit of code here and there, such as:
http://infohost.nmt.edu/tcc/cgi/pre....ng/dropdown.py
alex


Try:

1. Tkinter OptionMenu:
http://effbot.org/tkinterbook/optionmenu.htm

2. Pmw OptionMenu:
http://pmw.sourceforge.net/doc/OptionMenu.html

I would opt for these before a roll-your-own version.
Dec 15 '05 #3
James Stroud wrote:
Alex Hunsley wrote:
Can anyone recommend some code for creating drop-down menus in tkinter?
To be absolutely clear, here's an example of a drop-down:

http://www.google.co.uk/preferences?hl=en
(see the language selection widget)

I've found the odd bit of code here and there, such as:
http://infohost.nmt.edu/tcc/cgi/pre....ng/dropdown.py
alex

Try:

1. Tkinter OptionMenu:
http://effbot.org/tkinterbook/optionmenu.htm

2. Pmw OptionMenu:
http://pmw.sourceforge.net/doc/OptionMenu.html

I would opt for these before a roll-your-own version.


Thanks for those! :)
alex
Dec 16 '05 #4
James Stroud wrote:
Alex Hunsley wrote:
Can anyone recommend some code for creating drop-down menus in tkinter?
To be absolutely clear, here's an example of a drop-down:

http://www.google.co.uk/preferences?hl=en
(see the language selection widget)

I've found the odd bit of code here and there, such as:
http://infohost.nmt.edu/tcc/cgi/pre....ng/dropdown.py
alex

Try:

1. Tkinter OptionMenu:
http://effbot.org/tkinterbook/optionmenu.htm

2. Pmw OptionMenu:
http://pmw.sourceforge.net/doc/OptionMenu.html

I would opt for these before a roll-your-own version.

try searching for a ComboBox I think you will have more hits
I know Pmw has one, it is also quite easy to build your own
with an Entry, Button and Listbox widget + some nifty code ;)

Cheers,
Martin.

Dec 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by srijit | last post: by
2 posts views Thread by Rick Olson | last post: by
5 posts views Thread by Sean McIlroy | last post: by
reply views Thread by syed_saqib_ali | last post: by
3 posts views Thread by Eric S. Johansson | last post: by
2 posts views Thread by John Salerno | last post: by
44 posts views Thread by bg_ie | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.