X7ROOT File Manager
Current Path:
/usr/lib64/python2.7/Demo/tkinter/ttk
usr
/
lib64
/
python2.7
/
Demo
/
tkinter
/
ttk
/
📁
..
📄
combo_themes.py
(1.58 KB)
📄
combo_themes.pyc
(1.88 KB)
📄
combo_themes.pyo
(1.88 KB)
📄
dirbrowser.py
(2.65 KB)
📄
dirbrowser.pyc
(3.88 KB)
📄
dirbrowser.pyo
(3.88 KB)
📁
img
📄
listbox_scrollcmd.py
(1.13 KB)
📄
listbox_scrollcmd.pyc
(1.56 KB)
📄
listbox_scrollcmd.pyo
(1.56 KB)
📄
mac_searchentry.py
(3.63 KB)
📄
mac_searchentry.pyc
(3.88 KB)
📄
mac_searchentry.pyo
(3.88 KB)
📄
notebook_closebtn.py
(2.47 KB)
📄
notebook_closebtn.pyc
(2.91 KB)
📄
notebook_closebtn.pyo
(2.91 KB)
📄
plastik_theme.py
(9.36 KB)
📄
plastik_theme.pyc
(7.34 KB)
📄
plastik_theme.pyo
(7.34 KB)
📄
roundframe.py
(5.47 KB)
📄
roundframe.pyc
(6.28 KB)
📄
roundframe.pyo
(6.28 KB)
📄
theme_selector.py
(1.92 KB)
📄
theme_selector.pyc
(2.81 KB)
📄
theme_selector.pyo
(2.81 KB)
📄
treeview_multicolumn.py
(4.15 KB)
📄
treeview_multicolumn.pyc
(5.35 KB)
📄
treeview_multicolumn.pyo
(5.35 KB)
📄
ttkcalendar.py
(8.12 KB)
📄
ttkcalendar.pyc
(9.54 KB)
📄
ttkcalendar.pyo
(9.54 KB)
📄
widget_state.py
(2.66 KB)
📄
widget_state.pyc
(3.33 KB)
📄
widget_state.pyo
(3.33 KB)
Editing: combo_themes.py
"""Ttk Theme Selector. Although it is a theme selector, you won't notice many changes since there is only a combobox and a frame around. """ import ttk class App(ttk.Frame): def __init__(self): ttk.Frame.__init__(self) self.style = ttk.Style() self._setup_widgets() def _change_theme(self, event): if event.widget.current(): # value #0 is not a theme newtheme = event.widget.get() # change to the new theme and refresh all the widgets self.style.theme_use(newtheme) 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) def main(): app = App() app.master.title("Ttk Combobox") app.mainloop() if __name__ == "__main__": main()
Upload File
Create Folder