本文整理汇总了Python中Tkinter._setit方法的典型用法代码示例。如果您正苦于以下问题:Python Tkinter._setit方法的具体用法?Python Tkinter._setit怎么用?Python Tkinter._setit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter
的用法示例。
在下文中一共展示了Tkinter._setit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_menu
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import _setit [as 别名]
def set_menu(self, default=None, *values):
"""Build a new menu of radiobuttons with *values and optionally
a default value."""
menu = self['menu']
menu.delete(0, 'end')
for val in values:
menu.add_radiobutton(label=val,
command=Tkinter._setit(self._variable, val, self._callback))
if default:
self._variable.set(default)
示例2: SetMenu
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import _setit [as 别名]
def SetMenu(self,valueList,value=None):
"""
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['menu'].delete(0,'end')
for item in valueList:
self['menu'].add_command(label=item,
command=_setit(self.variable,item,self.command))
if value:
self.variable.set(value)
示例3: update_disk_optionmenu
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import _setit [as 别名]
def update_disk_optionmenu(self):
disk_list = controller.get_disk_list()
menu = self.menu_choose_disk['menu']
# clear all options
menu.delete(0, 'end')
# add new
if not disk_list:
raise Exception("No Acceptable disks found")
else:
for disk in disk_list:
menu.add_command(label=disk, command=_setit(self.disk_choice,disk))
self.disk_choice.set(disk)
示例4: refesh_span_options
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import _setit [as 别名]
def refesh_span_options(self,*event):
self.load_span_selection['menu'].delete(0,'end')
for choice in self.beam_labels:
self.load_span_selection['menu'].add_command(label=choice, command=tk._setit(self.load_span_select, choice))