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
1
vote
1 answer
Tkinter bringing chosen option from optionMenu into a variable for further use
when creating a drop-down menu in "tkinter" like this:
options = ['0',
'1',
'2',
'3',
'4']
option = tk.OptionMenu(menu, var, *options)
var.set('Select number')
I want to know exactly how I can take the…

Coder Cody
- 95
- 1
- 10
1
vote
1 answer
Tkinter OptionMenu cant use .get in a function
I'm writing some code and i need a variable to change when the optionMenu is changed here is some of my code below
#!/user
# -*- coding: utf-8 -*-
import locale
import Tkinter as Tk
root = Tk.Tk()
root.title("My Tax…

adam Wadsworth
- 774
- 1
- 8
- 26
0
votes
0 answers
Optionmenu selections are not shown when a tkinter app is merged with another
o1=OptionMenu(calc, conicvalue,
" Circle ",
" …
0
votes
0 answers
What are the options for changing widget fonts using the .option_add() method?
I am trying to set specific font styles to different types of widgets using the root.option_add() method.
For example:
root.option_add('*font', ('Courier New', 9)) # apply monospace font to all widgets
root.option_add('*Button.font', ('Courier…

penguinaut
- 1
- 1
0
votes
1 answer
Problem in running a function to delete image from a folder using tkinter
The following is the code to remove image from the specified folder using a dropdown:-
def remove_face():
folder_path = "KnownFaces" # Replace with the actual folder path
selected_file_var = StringVar()
selected_file_var.set("Select an…

Darsh. S.
- 13
- 3
0
votes
0 answers
Python | TkInter | Add/Delete Buttons/Rows in a Tkinter GUI
I have a GUI with an Option Menu that has a list of numbers (1:8). When a number is selected, an equal amount of buttons will be populated below. When those buttons are selected, a label next to it will be generated with the choice of folder…

Nev Pires
- 175
- 1
- 9
0
votes
1 answer
Create a dropdown to generate buttons and assign those buttons to specify file paths
I have a situation where a user has stored video data in different file paths. The number of these file paths can vary.
I've created a dropdown menu where the user can select how many file paths they want to select (e.g. 1 to 8).
When they select…

Nev Pires
- 175
- 1
- 9
0
votes
3 answers
Only one selection showing in drop down list
I am trying to display seven days from today's date in a Tkinter option menu, but when I run the script only one day gets printed.
When I print as per the code all seven days show in print but not on Tkinter.
from tkinter import *
from datetime…

Gmoss2112
- 1
- 2
0
votes
0 answers
tkinter grid with OptionMenu
I would like to align an OptionMenu using the grid in tkinter.
Here is a MWE:
from tkinter import *
from tkinter import ttk
metrics = ["A", "B", "C", "D", "E", "F", "G", "H"]
root = Tk()
root.title("random software")
content =…

Nocxy
- 111
- 7
0
votes
0 answers
conditional List comprehension (not equal to)
I have a quick question, can someone tell me why this is not working? -.-"
The point is to look through a the column "Owned by Team" filter out all the unique teams and then input them as a drop down menu in Tkinter.
Unfortunately at the moment I am…

Keyt Weyner
- 27
- 4
0
votes
1 answer
Can't change the width of the line in Canvas,through an OptionMenu value
I'm trying to create a simple paint app in tkinter. I have a function called paint and the code looks like this:
def paint( event):
x1, y1, x2, y2 = ( event.x-5),( event.y-5), ( event.x+5),( event.y+5)
Colour = "#CB5E7F"
…

the futurefeat
- 1
- 2
0
votes
1 answer
Tkinter command doesnt reacts in second OptionMenu
I have 2 OptionMenus.
The first one is to select Manufacturer and method assign to command clear options in second OptionMenu and add options assign to the selected manufacturer.
The problem is that second OptionMenu dont trigger the method assign…

Paweł Pietraszko
- 234
- 1
- 7
0
votes
0 answers
Option menu and tkinter
I am still a little new on python and tkinter and I have a question. I have a GUI that has two dropdowns the ultimate goal is to have each drop download load a second file. The question that I have is whether there is an ability that if I used one…

Patrick Perea
- 1
- 3
0
votes
1 answer
Assign different number of Option Menu's to different numbers of labels and extract the data in a pythonic way
I have a situation where I have two lists of different lengths. These lists may not be consistent every time this script is run, but for the purposes of this example, I'm going to use students and grades.
In this example, I have 4 students and 6…

Nev Pires
- 175
- 1
- 9
0
votes
0 answers
How do I create a dropdown menu without using OptionMenu for tkinter?
Whenever I run my code, there's a 50/50 chance it crashes when my dropdown menu is clicked, coming up with a "Segmentation fault: 11" on vscode, I've also tried on pycharm.
there is no apparent reason that this code shouldn't work, so I would like…