optionmenu

Updating options in optionmenu Tkinter

Updating options in optionmenu Tkinter Question: I am currently writing on a small hobby project and I have a problem concerning my list "dice" while using the dropdown menu it only ever shows the first iteration of the list (the single 0) but it is supposed to be updated in the dropdown menu after each …

Total answers: 1

Why am I getting a type error from this function?

Why am I getting a type error from this function? Question: I am trying to create a drop down menu in tkinter that allows the user to select a machine, or row # from the excel sheet, and then all the data from that entire row is displayed in tkinter through the display_selected function. I …

Total answers: 1

Changing the colour of the tk.optionmenu widget

Changing the colour of the tk.optionmenu widget Question: I use this command to create a tk.optionmenu widget but its a grey colour and I want it to be white. optionmenu = tk.OptionMenu(root,variable,*(variables)).place(x=375, y=175) How do I change it to the white colour? I’ve tried this but it doesn’t seem to work. Thanks! optionmenu = tk.OptionMenu(root,variable,*(variables)colour=”White”).place(x=375, …

Total answers: 2

Changing the options of a OptionMenu when clicking a Button

Changing the options of a OptionMenu when clicking a Button Question: Say I have an option menu network_select that has a list of networks to connect to. import Tkinter as tk choices = (‘network one’, ‘network two’, ‘network three’) var = tk.StringVar(root) network_select = tk.OptionMenu(root, var, *choices) Now, when the user presses the refresh button, …

Total answers: 4

How to make a OptionMenu maintain the same width?

How to make a OptionMenu maintain the same width? Question: I have a snippet which creates an OptionMenu widget. … options = (‘White’, ‘Grey’, ‘Black’, ‘Red’, ‘Orange’, ‘Yellow’, ‘Green’, ‘Blue’, ‘Cyan’, ‘Purple’) var = StringVar() optionmenu = OptionMenu(par, var, *options) optionmenu.grid(column=column, row=row) … One problem I’ve encountered is every time a new option is selected, …

Total answers: 4