]> granicus.if.org Git - python/commitdiff
Two independent changes:
authorGuido van Rossum <guido@python.org>
Tue, 30 Jul 1996 16:31:32 +0000 (16:31 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Jul 1996 16:31:32 +0000 (16:31 +0000)
- accept empty string from focus_get
- map coords() return value through getdouble and splitlist

Lib/lib-tk/Tkinter.py
Lib/tkinter/Tkinter.py

index ac814a96a2419ba6d5319408d7b5da533d199bbd..0cff594cfab12b4ae36121b363f76af859544776 100644 (file)
@@ -167,7 +167,7 @@ class Misc:
                self.tk.call('focus', 'none')
        def focus_get(self):
                name = self.tk.call('focus')
-               if name == 'none': return None
+               if name == 'none' or not Name: return None
                return self._nametowidget(name)
        def tk_focusNext(self):
                name = self.tk.call('tk_focusNext', self._w)
@@ -963,7 +963,8 @@ class Canvas(Widget):
                return self.tk.getdouble(self.tk.call(
                        self._w, 'canvasy', screeny, gridspacing))
        def coords(self, *args):
-               return self._do('coords', args)
+               return map(self.tk.getdouble,
+                           self.tk.splitlist(self._do('coords', args))
        def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
                args = _flatten(args)
                cnf = args[-1]
index ac814a96a2419ba6d5319408d7b5da533d199bbd..0cff594cfab12b4ae36121b363f76af859544776 100755 (executable)
@@ -167,7 +167,7 @@ class Misc:
                self.tk.call('focus', 'none')
        def focus_get(self):
                name = self.tk.call('focus')
-               if name == 'none': return None
+               if name == 'none' or not Name: return None
                return self._nametowidget(name)
        def tk_focusNext(self):
                name = self.tk.call('tk_focusNext', self._w)
@@ -963,7 +963,8 @@ class Canvas(Widget):
                return self.tk.getdouble(self.tk.call(
                        self._w, 'canvasy', screeny, gridspacing))
        def coords(self, *args):
-               return self._do('coords', args)
+               return map(self.tk.getdouble,
+                           self.tk.splitlist(self._do('coords', args))
        def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
                args = _flatten(args)
                cnf = args[-1]