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


Python Style.layout方法代码示例

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


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

示例1: remove_tab_controls

# 需要导入模块: from ttk import Style [as 别名]
# 或者: from ttk.Style import layout [as 别名]
    def remove_tab_controls(self):
        """Remove tab area and most tab bindings from this window."""
        if TTK:
            self.text_notebook['style'] = 'PyShell.TNotebook'
            style = Style(self.top)
            style.layout('PyShell.TNotebook.Tab', [('null', '')])
        else:
            self.text_notebook._tab_set.grid_forget()

        # remove commands related to tab
        if 'file' in self.menudict:
            menu = self.menudict['file']
            curr_entry = None
            i = 0
            while True:
                last_entry, curr_entry = curr_entry, menu.entryconfigure(i)
                if last_entry == curr_entry:
                    # no more menu entries
                    break

                if 'label' in curr_entry and 'Tab' in curr_entry['label'][-1]:
                    if 'Close' not in ' '.join(curr_entry['label'][-1]):
                        menu.delete(i)
                i += 1

        self.current_page.text.unbind('<<new-tab>>')
开发者ID:8848,项目名称:Pymol-script-repo,代码行数:28,代码来源:EditorWindow.py

示例2: styles

# 需要导入模块: from ttk import Style [as 别名]
# 或者: from ttk.Style import layout [as 别名]
    def styles():
        """Просто определяем все стили ttk в одной функции"""

        style = Style(root)
        style.configure('Chosen.TButton', foreground='#9900BB',
                      background='#9900BB', font=('verdana', FONT_SIZE, 'bold'))

        style.configure('Default.TButton', font=('verdana', FONT_SIZE))
        if USE_BACKGROUND:
            style.configure('Default.TButton', background='#aaaaaa')

        style.configure('Eat.TButton', font=('lucida console', FONT_SIZE_BIG))
        if USE_BACKGROUND:
            style.configure('Eat.TButton', background='#aaaaaa')

        style.configure('Eat2.TButton', font=('lucida console', FONT_SIZE_BIG),
                         foreground='#9300B3')
        if USE_BACKGROUND:
            style.configure('Eat2.TButton', background='#aaaaaa')

        style.configure('Little.TButton', font=('verdana', FONT_SIZE),
                        justify='center')
        style.configure('TMenubutton', font=('lucida console', FONT_SIZE_BIG),
                        justify='left')
        if TABS_HIDE:
            style.layout('Hidden.TNotebook.Tab', '')
        else:
            style.configure('Hidden.TNotebook.Tab',font=('verdana', FONT_SIZE))
        style.configure('Custom.TNotebook.Tab', font=('verdana', FONT_SIZE))
        style.configure('TButton', font=('verdana', FONT_SIZE),justify='center')
开发者ID:sychov,项目名称:conditer,代码行数:32,代码来源:gui.py


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