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


Python Tkinter.Widget方法代码示例

本文整理汇总了Python中Tkinter.Widget方法的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.Widget方法的具体用法?Python Tkinter.Widget怎么用?Python Tkinter.Widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tkinter的用法示例。


在下文中一共展示了Tkinter.Widget方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_app

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def get_app(self, parent):
        """
        If the plugin provides mainwindow content create and return it.
        :param parent: the parent frame for this entry.
        :returns: None, a tk Widget, or a pair of tk.Widgets
        """
        plugin_app = self._get_func('plugin_app')
        if plugin_app:
            try:
                appitem = plugin_app(parent)
                if appitem is None:
                    return None
                elif isinstance(appitem, tuple):
                    if len(appitem) != 2 or not isinstance(appitem[0], tk.Widget) or not isinstance(appitem[1], tk.Widget):
                        raise AssertionError
                elif not isinstance(appitem, tk.Widget):
                    raise AssertionError
                return appitem
            except:
                print_exc()
        return None 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:23,代码来源:plug.py

示例2: __init__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def __init__(self, master, widgetname, kw=None):
        """Constructs a Ttk Widget with the parent master.

        STANDARD OPTIONS

            class, cursor, takefocus, style

        SCROLLABLE WIDGET OPTIONS

            xscrollcommand, yscrollcommand

        LABEL WIDGET OPTIONS

            text, textvariable, underline, image, compound, width

        WIDGET STATES

            active, disabled, focus, pressed, selected, background,
            readonly, alternate, invalid
        """
        master = setup_master(master)
        if not getattr(master, '_tile_loaded', False):
            # Load tile now, if needed
            _load_tile(master)
        Tkinter.Widget.__init__(self, master, widgetname, kw=kw) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:27,代码来源:ttk.py

示例3: update

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def update(self, widget):
        assert isinstance(widget, tk.Widget) or isinstance(widget, tk.BitmapImage), widget
        if not self.current:
            return	# No need to call this for widgets created in plugin_app()
        self.register(widget)
        self._update_widget(widget)
        if isinstance(widget, tk.Frame) or isinstance(widget, ttk.Frame):
            for child in widget.winfo_children():
                self._update_widget(child)

    # Apply current theme to a single widget 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:13,代码来源:theme.py

示例4: state

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def state(self, statespec=None):
        """Modify or inquire widget state.

        Widget state is returned if statespec is None, otherwise it is
        set according to the statespec flags and then a new state spec
        is returned indicating which flags were changed. statespec is
        expected to be a sequence."""
        if statespec is not None:
            statespec = ' '.join(statespec)

        return self.tk.splitlist(str(self.tk.call(self._w, "state", statespec))) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:13,代码来源:ttk.py

示例5: configure

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def configure(self, cnf=None, **kw):
        """Modify or query scale options.

        Setting a value for any of the "from", "from_" or "to" options
        generates a <<RangeChanged>> event."""
        if cnf:
            kw.update(cnf)
        Widget.configure(self, **kw)
        if any(['from' in kw, 'from_' in kw, 'to' in kw]):
            self.event_generate('<<RangeChanged>>') 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:12,代码来源:ttk.py

示例6: _subwidget_name

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def _subwidget_name(self,name):
        """Get a subwidget name (returns a String, not a Widget !)"""
        try:
            return self.tk.call(self._w, 'subwidget', name)
        except TclError:
            return None 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:8,代码来源:Tix.py

示例7: __getitem__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import Widget [as 别名]
def __getitem__(self,key):
        return self.tk.call(self.stylename, 'cget', '-%s'%key)


######################################################
### The Tix Widget classes - in alphabetical order ###
###################################################### 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:9,代码来源:Tix.py


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