[Python-checkins] r65295 - sandbox/trunk/ttk-gsoc/samples/theming.py
guilherme.polo
python-checkins at python.org
Wed Jul 30 04:51:00 CEST 2008
Author: guilherme.polo
Date: Wed Jul 30 04:50:59 2008
New Revision: 65295
Log:
Change current theme in use, as needed, while loading a saved file, and then refresh the preview area after it finishes.
Modified:
sandbox/trunk/ttk-gsoc/samples/theming.py
Modified: sandbox/trunk/ttk-gsoc/samples/theming.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/samples/theming.py (original)
+++ sandbox/trunk/ttk-gsoc/samples/theming.py Wed Jul 30 04:50:59 2008
@@ -784,14 +784,24 @@
showerror("Theme file couldn't be loaded", err, parent=self.master)
return
+ current_theme = self._style.theme_use()
+
for theme in self._style.theme_names():
+ self._style.theme_use(theme)
themeobj.load_configure(get_section_items(themeobj,
'%s-configure' % theme))
themeobj.load_map(get_section_items(themeobj, '%s-map' % theme))
themeobj.load_layout(get_section_items(themeobj,
'%s-layout' % theme))
+ # restore theme
+ self._style.theme_use(current_theme)
+ # refresh widget preview
+ treeview = self._tv_widgets
+ self._change_preview(treeview, invalid=True)
+ # update file in use
self._filename = fname
+
themeobj.close()
def _save_theme(self, event=None):
More information about the Python-checkins
mailing list