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

guilherme.polo python-checkins at python.org
Tue Jul 1 16:34:13 CEST 2008


Author: guilherme.polo
Date: Tue Jul  1 16:33:39 2008
New Revision: 64613

Log:
Not worth adding the possibility to remove custom options, it requires
creating a new layout every time;
Empty _current_options after running pack_forget on every widget;


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	Tue Jul  1 16:33:39 2008
@@ -6,8 +6,6 @@
 
 # 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.
@@ -480,6 +478,7 @@
         # remove previous widgets
         for widget in self._current_options:
             widget.pack_forget()
+        self._current_options = []
 
     def _update_style_configframe(self):
         """Update the configure frame for the current widget."""
@@ -515,13 +514,14 @@
             return True
 
         lbl = ttk.Label(frame, text=opt_name)
+        lbl.pack(side='top', anchor='w')
         entry = ttk.Entry(frame)
         entry.insert(0, opt_value)
         entry.configure(validate='key',
             validatecommand=(self.master.register(change_opt), opt_name, '%P'))
         entry.validate()
-        lbl.pack(side='top', anchor='w')
         entry.pack(side='top', fill='x', pady=3)
+
         self._current_options = self._current_options or []
         self._current_options.extend([lbl, entry])
 


More information about the Python-checkins mailing list