当前位置: 首页>>代码示例>>Python>>正文


Python tkinter._setit方法代码示例

本文整理汇总了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) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:13,代码来源:ttk.py

示例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) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:14,代码来源:dynOptionMenuWidget.py

示例3: on_skills_ready

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import _setit [as 别名]
def on_skills_ready(self, skills_as_array: List[str]):
        self.selected_skills_dropmenu.configure(state="active")
        self.selected_skills_dropmenu["menu"].delete(0, 'end')

        for skill in skills_as_array[1:-1]:
            name_skill, active = self.clear_text(skill)
            self.selected_skills_dropmenu["menu"].add_command(
                label=name_skill,
                command=tk._setit(self.selected_skills, name_skill))

            if active:
                self.presenter.current_active_skill = self.extract_skill_name(name_skill)[0]
                self.selected_skills.set(name_skill) 
开发者ID:IBM,项目名称:clai,代码行数:15,代码来源:clai_emulator.py

示例4: _refresh_options

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import _setit [as 别名]
def _refresh_options(self):
        # save which option was selected
        selected = self.value

        self._combo_menu.tk.delete(0, END)

        # Re-add all options
        # This uses an internal tk method _setit which is a bit naughty
        for item in self._options:
            self._combo_menu.tk.add_command(label=item, command=_setit(self._selected, item, self._command_callback))

        self.description = "[Combo] object with options  " + str(self._options)

        # set the option which was previously selected
        self._set_option(selected) 
开发者ID:lawsie,项目名称:guizero,代码行数:17,代码来源:Combo.py


注:本文中的tkinter._setit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。