473,326 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 13726
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: srijit | last post by:
Hello, Any idea - why the following code crashes on my Win 98 machine with Python 2.3? Everytime I run this code, I have to reboot my machine. I also have Win32all-157 installed. from Tkinter...
8
by: Marc | last post by:
Hi all, I was thinking about developing a drag and drop application and was curious how difficult it is to do. Basically I want to have a set of objects that I move around the screen and drop...
2
by: Rick Olson | last post by:
I'm trying to add a Tkinter interface to an existing C program with embedded python, but seem to have trouble importing Tkinter (or accessing it). I tried a simple program that would run the...
5
by: Sean McIlroy | last post by:
The subject line essentially says it all. Is there a way to do it? If so, where do I look to find out how? Any help will be much appreciated. Thx, STM
0
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust...
3
by: Eric S. Johansson | last post by:
I have a small problem that may be best solved by dragging and dropping a mail message to an icon. But I'm honestly not sure what the data will look like from different e-mail clients. Since most...
2
by: John Salerno | last post by:
I'm a little confused. I was under the impression (perhaps incorrectly) that Tkinter will create GUI widgets that are native to your OS, so I should have an XPish looking application. But when I...
44
by: bg_ie | last post by:
Hi, I'm in the process of writing some code and noticed a strange problem while doing so. I'm working with PythonWin 210 built for Python 2.5. I noticed the problem for the last py file...
13
by: Daniel Fetchinson | last post by:
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , Is it just me or others also think that it would be a major loss to remove tkinter from the python core? PEP 3108 starts off...
0
by: BirdaoGwra | last post by:
Hi, I hv created an application with Tkinter/PIL in python25. It can import an image into the canvas. Now could someone kindly tell me how to select and move that image with mouse? Any help would...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.