tkinter: drop-down widget

A

Alex Hunsley

Alex said:
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.cgi?file=/u/www/docs/tcc/help/lang/python/mapping/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
 
J

James Stroud

Alex said:
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.cgi?file=/u/www/docs/tcc/help/lang/python/mapping/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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top