MCPcopy Index your code
hub / github.com/python/cpython / SetMenu

Method SetMenu

Lib/idlelib/dynoption.py:19–30  ·  view source on GitHub ↗

clear and reload the menu with a new set of options. valueList - list of new options value - initial value to set the optionmenu's menubutton to

(self,valueList,value=None)

Source from the content-addressed store, hash-verified

17 self.command = kwargs.get('command')
18
19 def SetMenu(self,valueList,value=None):
20 """
21 clear and reload the menu with a new set of options.
22 valueList - list of new options
23 value - initial value to set the optionmenu's menubutton to
24 """
25 self['menu'].delete(0,'end')
26 for item in valueList:
27 self['menu'].add_command(label=item,
28 command=_setit(self.variable,item,self.command))
29 if value:
30 self.variable.set(value)
31
32
33def _dyn_option_menu(parent): # htest #

Callers 13

updateFunction · 0.80
load_font_cfgMethod · 0.80
load_theme_cfgMethod · 0.80
create_newMethod · 0.80
delete_customMethod · 0.80
load_key_cfgMethod · 0.80
create_new_key_setMethod · 0.80
delete_custom_keysMethod · 0.80
test_builtin_nameMethod · 0.80
test_custom_nameMethod · 0.80
test_builtin_nameMethod · 0.80

Calls 4

_setitClass · 0.90
add_commandMethod · 0.80
deleteMethod · 0.45
setMethod · 0.45

Tested by 5

test_builtin_nameMethod · 0.64
test_custom_nameMethod · 0.64
test_builtin_nameMethod · 0.64
test_custom_nameMethod · 0.64