[Python-checkins] r66292 - in sandbox/trunk/ttk-gsoc/src: 2.x/ttk.py 3.x/ttk.py

guilherme.polo python-checkins at python.org
Sun Sep 7 14:42:13 CEST 2008


Author: guilherme.polo
Date: Sun Sep  7 14:42:13 2008
New Revision: 66292

Log:
Layout fixes


Modified:
   sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
   sandbox/trunk/ttk-gsoc/src/3.x/ttk.py

Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py	Sun Sep  7 14:42:13 2008
@@ -378,8 +378,9 @@
             query_opt = ('' if query_opt.startswith('-') else '-') + query_opt
             return self.tk.call(self._name, "configure", style, query_opt)
 
-        return _dict_from_tcltuple(self.tk.call(self._name, "configure", style,
-                                                *(_format_optdict(kw))))
+        return _dict_from_tcltuple(
+            self.tk.call(
+                self._name, "configure", style, *(_format_optdict(kw))))
 
 
     def map(self, style, query_opt=None, **kw):
@@ -392,11 +393,11 @@
         one or more states and then a value."""
         if query_opt:
             query_opt = ('' if query_opt.startswith('-') else '-') + query_opt
-            return _list_from_statespec(self.tk.call(self._name, "map", style,
-                                                     query_opt))
+            return _list_from_statespec(
+                self.tk.call(self._name, "map", style, query_opt))
 
-        return _dict_from_tcltuple(self.tk.call(self._name, "map", style,
-                                                *(_format_mapdict(kw))))
+        return _dict_from_tcltuple(
+            self.tk.call(self._name, "map", style, *(_format_mapdict(kw))))
 
 
     def lookup(self, style, option, state=None, default=None):
@@ -450,15 +451,15 @@
             lspec = "null" # could be any other word, but this may make sense
                            # when calling layout(style) later
 
-        return _list_from_layouttuple(self.tk.call(self._name, "layout", style,
-                                                   lspec))
+        return _list_from_layouttuple(
+            self.tk.call(self._name, "layout", style, lspec))
 
 
     def element_create(self, elementname, etype, *args, **kw):
         """Create a new element in the current theme of given etype."""
         spec, opts = _format_elemcreate(etype, False, *args, **kw)
         self.tk.call(self._name, "element", "create", elementname, etype,
-                     spec, *opts)
+            spec, *opts)
 
 
     def element_names(self):
@@ -482,10 +483,10 @@
 
         if parent:
             self.tk.call(self._name, "theme", "create", themename,
-                         "-parent", parent, "-settings", script)
+                "-parent", parent, "-settings", script)
         else:
             self.tk.call(self._name, "theme", "create", themename,
-                         "-settings", script)
+                "-settings", script)
 
 
     def theme_settings(self, themename, settings):
@@ -1329,8 +1330,8 @@
         is generated."""
         opts = _format_optdict(kw)
         if iid:
-            res = self.tk.call(self._w, "insert", parent, index, "-id", iid,
-                               *opts)
+            res = self.tk.call(self._w, "insert", parent, index,
+                "-id", iid, *opts)
         else:
             res = self.tk.call(self._w, "insert", parent, index, *opts)
 
@@ -1440,7 +1441,7 @@
         tagname). With no additional arguments, returns a dictionary of
         the option settings for tagname."""
         return _val_or_dict(kw, self.tk.call, self._w, "tag", "configure",
-                            tagname)
+            tagname)
 
 
     def tag_has(self, tagname, item=None):
@@ -1465,7 +1466,7 @@
 # Extensions
 
 class LabeledScale(Frame, object):
-    """A Ttk Scale widget with a Ttk Label widget over it indicating its
+    """A Ttk Scale widget with a Ttk Label widget indicating its
     current value.
     
     The Ttk Scale can be accessed through instance.scale, and Ttk Label
@@ -1483,6 +1484,7 @@
                 Defaults to 'top'.
         """
         self._label_top = kw.pop('compound', 'top') == 'top'
+
         Frame.__init__(self, master, **kw)
         self._variable = variable or Tkinter.IntVar(master)
         self._variable.set(from_)

Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py	Sun Sep  7 14:42:13 2008
@@ -378,8 +378,9 @@
             query_opt = ('' if query_opt.startswith('-') else '-') + query_opt
             return self.tk.call(self._name, "configure", style, query_opt)
 
-        return _dict_from_tcltuple(self.tk.call(self._name, "configure", style,
-                                                *(_format_optdict(kw))))
+        return _dict_from_tcltuple(
+            self.tk.call(
+                self._name, "configure", style, *(_format_optdict(kw))))
 
 
     def map(self, style, query_opt=None, **kw):
@@ -392,11 +393,11 @@
         one or more states and then a value."""
         if query_opt:
             query_opt = ('' if query_opt.startswith('-') else '-') + query_opt
-            return _list_from_statespec(self.tk.call(self._name, "map", style,
-                                                     query_opt))
+            return _list_from_statespec(
+                self.tk.call(self._name, "map", style, query_opt))
 
-        return _dict_from_tcltuple(self.tk.call(self._name, "map", style,
-                                                *(_format_mapdict(kw))))
+        return _dict_from_tcltuple(
+            self.tk.call(self._name, "map", style, *(_format_mapdict(kw))))
 
 
     def lookup(self, style, option, state=None, default=None):
@@ -450,15 +451,15 @@
             lspec = "null" # could be any other word, but this may make sense
                            # when calling layout(style) later
 
-        return _list_from_layouttuple(self.tk.call(self._name, "layout", style,
-                                                   lspec))
+        return _list_from_layouttuple(
+            self.tk.call(self._name, "layout", style, lspec))
 
 
     def element_create(self, elementname, etype, *args, **kw):
         """Create a new element in the current theme of given etype."""
         spec, opts = _format_elemcreate(etype, False, *args, **kw)
         self.tk.call(self._name, "element", "create", elementname, etype,
-                     spec, *opts)
+            spec, *opts)
 
 
     def element_names(self):
@@ -482,10 +483,10 @@
 
         if parent:
             self.tk.call(self._name, "theme", "create", themename,
-                         "-parent", parent, "-settings", script)
+                "-parent", parent, "-settings", script)
         else:
             self.tk.call(self._name, "theme", "create", themename,
-                         "-settings", script)
+                "-settings", script)
 
 
     def theme_settings(self, themename, settings):
@@ -1329,8 +1330,8 @@
         is generated."""
         opts = _format_optdict(kw)
         if iid:
-            res = self.tk.call(self._w, "insert", parent, index, "-id", iid,
-                               *opts)
+            res = self.tk.call(self._w, "insert", parent, index,
+                "-id", iid, *opts)
         else:
             res = self.tk.call(self._w, "insert", parent, index, *opts)
 
@@ -1440,7 +1441,7 @@
         tagname). With no additional arguments, returns a dictionary of
         the option settings for tagname."""
         return _val_or_dict(kw, self.tk.call, self._w, "tag", "configure",
-                            tagname)
+            tagname)
 
 
     def tag_has(self, tagname, item=None):
@@ -1465,7 +1466,7 @@
 # Extensions
 
 class LabeledScale(Frame):
-    """A Ttk Scale widget with a Ttk Label widget over it indicating its
+    """A Ttk Scale widget with a Ttk Label widget indicating its
     current value.
     
     The Ttk Scale can be accessed through instance.scale, and Ttk Label
@@ -1483,6 +1484,7 @@
                 Defaults to 'top'.
         """
         self._label_top = kw.pop('compound', 'top') == 'top'
+
         Frame.__init__(self, master, **kw)
         self._variable = variable or tkinter.IntVar(master)
         self._variable.set(from_)


More information about the Python-checkins mailing list