Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the options of a OptionMenu when clicking a Button

Tags:

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, I want to update the list of networks that the user can connect to.

  • I don't I can use .config because I looked through network_select.config() and didn't see an entry that looked like the choices I gave it.
  • I don't think this is something one can change using a tk variable, because there is no such thing as a ListVar.