[Python-checkins] r64039 - in sandbox/trunk/ttk-gsoc/src: 2.x/ttk.py 3.x/ttk.py
guilherme.polo
python-checkins at python.org
Sun Jun 8 16:57:53 CEST 2008
Author: guilherme.polo
Date: Sun Jun 8 16:57:53 2008
New Revision: 64039
Log:
_dict_from_tcltuple now converts generic Tcl objects to their string
representation;
Treeview's heading now, more correctly, uses _val_or_dict instead of a plain
tk.call
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 Jun 8 16:57:53 2008
@@ -268,6 +268,10 @@
# could be a statespec
val = _list_from_statespec(val)
+ elif hasattr(val, 'typename'):
+ # some other Tcl object
+ val = str(val)
+
opts.append((str(opt)[opt_start:], val))
return dict(opts)
@@ -1191,7 +1195,7 @@
# callback not registered yet, do it now
kw['command'] = self.master.register(cmd, self._substitute)
- return self.tk.call(self._w, "heading", column, *(_format_optdict(kw)))
+ return _val_or_dict(kw, self.tk.call, self._w, 'heading', column)
def identify(self, component, x, y):
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 Jun 8 16:57:53 2008
@@ -268,6 +268,10 @@
# could be a statespec
val = _list_from_statespec(val)
+ elif hasattr(val, 'typename'):
+ # some other Tcl object
+ val = str(val)
+
opts.append((str(opt)[opt_start:], val))
return dict(opts)
@@ -1191,7 +1195,7 @@
# callback not registered yet, do it now
kw['command'] = self.master.register(cmd, self._substitute)
- return self.tk.call(self._w, "heading", column, *(_format_optdict(kw)))
+ return _val_or_dict(kw, self.tk.call, self._w, 'heading', column)
def identify(self, component, x, y):
More information about the Python-checkins
mailing list