combo_themes.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:python2-tracer 作者: extremecoders-re 项目源码 文件源码
def _setup_widgets(self):
        themes = list(self.style.theme_names())
        themes.insert(0, "Pick a theme")
        # Create a readonly Combobox which will display 4 values at max,
        # which will cause it to create a scrollbar if there are more
        # than 4 values in total.
        themes_combo = ttk.Combobox(self, values=themes, state="readonly",
                                    height=4)
        themes_combo.set(themes[0]) # sets the combobox value to "Pick a theme"
        # Combobox widget generates a <<ComboboxSelected>> virtual event
        # when the user selects an element. This event is generated after
        # the listbox is unposted (after you select an item, the combobox's
        # listbox disappears, then it is said that listbox is now unposted).
        themes_combo.bind("<<ComboboxSelected>>", self._change_theme)
        themes_combo.pack(fill='x')

        self.pack(fill='both', expand=1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号