The purpose of this widget is to offer a fixed set of choices to the user in a drop-down menu.
Questions tagged [tkinter.optionmenu]
66 questions
14
votes
2 answers
Updating OptionMenu from List
I have an OptionMenu in my GUI that is being populated by a list. Every time the user runs a certain process the list updates to reflect this. Is there a way to update the OptionMenu based on the list? I've tried self.plotWindow.update() as per this…

wes3449
- 305
- 1
- 2
- 10
10
votes
2 answers
get rid of white border around option menu
I'm trying to get rid of the white border around the OptionMenu.
What I tried
I changed the colour to red, but there is still a white border around it.
Can anyone help?
Here's the code:
from tkinter import *
import tkinter as tk
from tkinter import…

coderoftheday
- 1,987
- 4
- 7
- 21
4
votes
1 answer
Tkinter OptionMenu: How to configure font size of drop down list?
I have an option menu list with a lot of entries to be used on a touch screen device. I am able to change the font size of the selected category with PopMenue.config(font=[something]), but when selecting the drop down menu the entries appear in the…

TobsterJ
- 43
- 1
- 4
3
votes
1 answer
How to make border around ttk.OptionMenu
While trying to make an entry frame I ran into a problem where I can't make border around ttk.OptionMenu in order to make it look similiar to ttk.Entry. (The two next to each other are in image)
Making OptionMenu
option =…

Ladislav Louka
- 256
- 4
- 21
2
votes
2 answers
How to triger a button based on the selected option in menu in tkinkter?
I have a list and 3 paths. Every path refers to an application that runs specifically for that country.
country = ['Spain', 'United Kingdom', 'Malaysia']
path_spain = r"c:\data\FF\Desktop\PythonFolder\spain_software.py"
path_uk =…

TangerCity
- 775
- 2
- 7
- 13
1
vote
1 answer
Tkinter, Change OptionMenu based on what is selected in another OptionMenu ANY TIME
I am creating a calendar app using tkinter module. My problem is that I would like the user to select a specific date. That means I have 3 option menus (year, month, day) in the SAME frame. The problem is that the number of days in a month is not…

Jan Kubica
- 11
- 1
1
vote
1 answer
Changing one OptionMenu changes the second one
In my code below I have two option menus which are populated with the same list. In the final application the list is generated by importing a .csv file.
The user should be able to select two entries from the list.
Now the problem is, that changing…

Bakira
- 79
- 9
1
vote
1 answer
Tkinter Option Menu First Value Disappears
I am using Tkinter to build a form with some conditional logic. There are two Option Menus, and the options available in the second depend on the user's selection in the first. For some reason, however, the default option in the first menu…

bbernicker
- 158
- 1
- 14
1
vote
0 answers
Tkinter OptionMenu closes when reaches out of screen
I have a large list of environments loaded into an OptionMenu. When you open it, it will immediately close once you let go of the mouse button if the opened menu reaches outside of the screen. Is there any way to deal with this? (for example making…

Natan
- 728
- 1
- 7
- 23
1
vote
1 answer
How to add titles to multiple OptionMenu's in tkinter?
I have the following 3 lists:
owner = ['Spain', 'United Kingdom', 'Malaysia']
phase= ['A100', 'B100', 'C100']
machine = ['LLT', 'AAF', 'GGG', 'TGF']
With above lists I'm trying to make 3 OptionMenus, this works great. However, when I try to add…

TangerCity
- 775
- 2
- 7
- 13
1
vote
1 answer
How to get selected value from the Tkinter OptionMenu
I am trying to get the selected option from the given below OptionMenu, but I am not able to use the selected value globally.
def callback(selection):
print(selection)
return selection
yearl=Label(Frame1, text='Select Year…

Gulam Ahmed
- 13
- 1
- 4
1
vote
1 answer
Is there a way to change the color of a specific option in ttk.OptionMenu on Windows?
I'm trying to write a code to change the color of a specific option in ttk.OptionMenu with press of a button (only that option should appear with the color when seen in the drop down). Here is a code similar to my need.
from tkinter import *
from…

astqx
- 2,058
- 1
- 10
- 21
1
vote
0 answers
ttk.OptionMenu outer border around the menu
I try to style a tkinter gui, first this gui is not easy to modify.
I reach the styling i want for the widgets i use, except for one think.
I get lock about this light gray border around the Menu in the ttk.OptionMenu widget.
How removing or…

lluull
- 19
- 4
1
vote
1 answer
Change OptionMenu based on what is selected in another OptionMenu and use the selection to pull data from a Database
I am trying to make a drop menu to choose an item from a list and use this item to select a second item from another list and finally use the last one to pull data from a database.
now I am able to choose the first option menu but for whatever…

Basheer Al-Kafaf
- 25
- 6
1
vote
0 answers
Updating OptionMenu selection based on antoher Option menu selection (Python 3/Tkinter)
I have written this unit conversion tool (GUI), which has 3 OptionMenus, The first one to choose the scale, the 2nd and 3rd are the 'Original unit' (convert from) and 'Convert to' menus.
# **** Unit Conversion tool ****
# A GUI unit conversion tool…

Kodai64
- 11
- 3