[Python-checkins] r64936 - sandbox/trunk/ttk-gsoc/samples/theming.py
guilherme.polo
python-checkins at python.org
Mon Jul 14 00:51:15 CEST 2008
Author: guilherme.polo
Date: Mon Jul 14 00:51:15 2008
New Revision: 64936
Log:
Check for wanted names now, instead of discarding unwanted names.
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 Mon Jul 14 00:51:15 2008
@@ -25,8 +25,11 @@
"""Maps Ttk widgets to their respective layout(s), factory and
possibly other things."""
widgets = {}
- # will discard Style and extension classes
- unwanted_names = ('Style', 'LabeledScale', 'OptionMenu')
+ wanted_names = ("Button", "Checkbutton", "Combobox", "Entry", "Frame",
+ "Label", "Labelframe", "Menubutton", "Notebook", "Panedwindow",
+ "Progressbar", "Radiobutton", "Scale", "Scrollbar", "Separator",
+ "Sizegrip", "Treeview")
+
# some widgets contain Vertical and Horizontal layouts
vert_horiz = ('Progressbar', 'Scale', 'Scrollbar')
# several widgets contain a single layout named as Twidgetname
@@ -42,12 +45,7 @@
'Menubutton': widget_menubtn, 'Panedwindow': widget_paned}
for name in ttk.__all__:
- if name in unwanted_names:
- continue
-
- name = name.title()
- if name in widgets:
- # do not add aliases
+ if name not in wanted_names:
continue
widget_d = {'factory': None, 'layouts': None}
More information about the Python-checkins
mailing list