[Python-checkins] r64594 - sandbox/trunk/ttk-gsoc/samples/theming.py

guilherme.polo python-checkins at python.org
Mon Jun 30 01:07:59 CEST 2008


Author: guilherme.polo
Date: Mon Jun 30 01:07:59 2008
New Revision: 64594

Log:
Updated ToDo list;
Fixed misleading name/docstring for the function available_widgets.


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 Jun 30 01:07:59 2008
@@ -1,14 +1,16 @@
 """
 Sample application for playing with Ttk theming.
-* A lot of features are missing for now.
 
 -- Guilherme Polo, 2008.
 """
 
-# ToDO: Add a way to remove options.
-#       Add a way to edit images/elements.
-#       Add pre-defined elements for the current theme.
-#       ...
+# XXX ToDo List:
+#   * Save/Load style changes, maybe.
+#   * Add a way to remove options (only custom options):
+#       - Not possible in tk, but could recreate the widget and not set it.
+#   * Add a way to edit images/elements.
+#   * Add pre-defined elements for the current theme:
+#       - Just after editing elements feature is added.
 
 import sys
 import ttk
@@ -19,8 +21,9 @@
 from tkMessageBox import showwarning
 from tkFileDialog import askopenfilename
 
-def available_widgets(): # XXX misleading function name
-    """Returns a list of Ttk widgets.""" # XXX misleading docstring
+def map_widgets():
+    """Maps Ttk widgets to their respective layout(s), factory and
+    possibly others."""
     widgets = {}
     # will discard Style and extension classes
     unwanted_names = ('Style', 'LabeledScale', 'OptionMenu')
@@ -641,8 +644,6 @@
         file_menu.add_command(label="Exit", underline=1, accelerator="Ctrl-X",
             command=self.master.destroy)
 
-        layout_menu = Tkinter.Menu(menu, tearoff=False)
-
         menu.add('cascade', menu=file_menu, label="File", underline=0)
         self.master.bind('<Control-x>', 'exit')
 
@@ -726,7 +727,7 @@
 
         # bottom frame (layout)
         bottom = ttk.Frame(paned, padding=[0, 0, 6])
-        bottom.pack(side='bottom')#, fill='both', expand=False)
+        bottom.pack(side='bottom')
         layoutframe = ttk.Labelframe(bottom, text="Layout", padding=6)
         layoutframe.pack(fill='both', expand=True)
         textframe = ttk.Frame(layoutframe)
@@ -757,7 +758,7 @@
     def __fill_treeview(self):
         """Insert available widgets in the treeview."""
         self._widget = {}
-        widgets = available_widgets()
+        widgets = map_widgets()
         for name, opts in sorted(widgets.items()):
             self._add_widget(name, opts)
 


More information about the Python-checkins mailing list