Questions tagged [tkinter.optionmenu]

The purpose of this widget is to offer a fixed set of choices to the user in a drop-down menu.

66 questions
0
votes
0 answers

I need to return the option clicked of two menu options in python tkinter

i'm making a unit converter in python, it has 3 options menus, the option menu one it contains the type of the thing that you are trying to convert (pression, temperatury, time, data transmission, velocity, area, etc), the option menu two and three…
0
votes
0 answers

Tkinter Update Button for an Optionmenu with images

I have three images in a folder: Image1, Image2, Image3 and I created an option menu with images like this: If I insert another image4 instead of image1 and click update button then I have: I can't how update the images with update file list…
James P.
  • 41
  • 5
0
votes
1 answer

"TypeError: __init__() takes from 2 to 3 positional arguments but 9 were given" but i tested in a new project file and worked fine

I'm trying to get the optionmenu to work on my current project file but i keep getting the error TypeError: init() takes from 2 to 3 positional arguments but 9 were given so i wanted to see if it was the code, and i made a new project file and…
0
votes
1 answer

Tkinter: function doesn't print when option menus are dynamically linked

I'm trying to create 2 OptionMenus that depend on each other in a way that the selection on the first will provide different options for the second. I was able to link those two together using trace. Both OptionMenus are linked to a command and…
Thanos
  • 594
  • 2
  • 7
  • 28
0
votes
0 answers

Tkinter - How to assign items of list to Option Menu?

I'm new in python and started creating this code without any experience and of course I can't know a lot about coding and I will do a lot of stupid mistakes, and this case is not exception as well. I tried to assign option menu to my list, but I…
Alexander Urum
  • 141
  • 1
  • 9
0
votes
1 answer

python bugfix: various tkinter option menus pick same option

I"m writing a GUI in Python for an interface for an microcontroller board which enables the user to select the kind of sensor for each channel to be read using tkinter. Since there are a few of them, I wanted to set them up by a loop. Now the…
hptty
  • 3
  • 2
0
votes
0 answers

How can I update the options in a tkinter OptionMenu without deleting and recreating it?

I have two OptionMenu widgets in a frame in my tkinter application. The first widget is a drop-down menu with chapter numbers of a book, the second is another drop-down menu that should show page numbers for the chapter that was selected in the…
AdeDoyle
  • 361
  • 1
  • 14
0
votes
3 answers

How to change a buttons state from disabled to active when an option is selected in an OptionMenu Tkinter

I'm trying to change the button state when an option is selected in the option menu, but nothing is changing. Can anyone tell me what I'm doing wrong? from tkinter import * def setLabel(): changed.set("Active") def changeState(): pick…
0
votes
2 answers

Adding a check next to the selected item in tkinter OptionMenu

How could I add a check sign next to the currently selected item (or highlight it) in a OptionMenu in a tkinter GUI? The idea is that when I click again to select another item, I can see easily which one is selected (similar to the following…
0
votes
1 answer

How to stop tkinter OptionMenu that contains checkbutton from closing when an item is checked

I have an OptionMenu widget what I added some checkbuttons. It keeps closing when an item is check and I want it to stop doing this here's the code drop1=OptionMenu(frame2, variable=clicked1,value="Options :") other_variables={} for o in…
0
votes
1 answer

add options to option menu with the same command as all the others

Hi im trying to add options to an option menu depending on how many options the user wants, I haven't included the user input part because it isn't necessary in solving the problem. I want all the options in the option menu to call the class…
coderoftheday
  • 1,987
  • 4
  • 7
  • 21
0
votes
1 answer

cannot select option from optionmenu after adding it to list in tkinter

I made a small tkinter window which has dropdown options and I wish to add new options to it, the code below adds options to the list, but I cannot select any when i click on them. The command attached with the optionmenu doesn't print the newly…
Sugato
  • 35
  • 8
0
votes
1 answer

OptionMenu add_command needs direct command?

I am stuck I am changing the content of an OptionMenu with the refresh() function and it works fine in case A but when in case B where I change it to a callback the OptionMenu stops working. Clicking on an option no longer selects it. Any idea what…
XGG
  • 41
  • 5
0
votes
0 answers

Using tkinter optionMenu

I am new to Python and I want to present a dropdownlist i.e. Netflix, Now TV, Amazon Prime etc using the optionmenu provided by TKinter. The dropdownlist should display the text values listed above but each item will have a unique identifier which I…
hebog
  • 1
0
votes
0 answers

How to update list that gets values from OptionMenu when changing menu choice - Python

So I am writing a GUI where you start with 1 optionmenu and the user can add more optionmenus. To add the additional optionmenus, I use a function: def addmove(): global movecount, customalts, customvarlist if ((customvarlist[-1] == "Choose…