From 8371013f9a50cf0fb38ba39dce1d83c6543ce9d3 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 27 Dec 1996 15:33:17 +0000 Subject: Added config(ure) method to Image class. (Fred Drake) --- Lib/lib-tk/Tkinter.py | 10 ++++++++++ Lib/tkinter/Tkinter.py | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 1e49f6e..286a557 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1612,6 +1612,16 @@ class Image: self.tk.call(self.name, 'configure', '-'+key, value) def __getitem__(self, key): return self.tk.call(self.name, 'configure', '-'+key) + def config(self, **kw): + res = () + for k, v in _cnfmerge(kw).items(): + if v is not None: + if k[-1] == '_': k = k[:-1] + if callable(v): + v = self._register(v) + res = res + ('-'+k, v) + apply(self.tk.call, (self.name, 'config') + res) + configure = config def height(self): return self.tk.getint( self.tk.call('image', 'height', self.name)) diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index 1e49f6e..286a557 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -1612,6 +1612,16 @@ class Image: self.tk.call(self.name, 'configure', '-'+key, value) def __getitem__(self, key): return self.tk.call(self.name, 'configure', '-'+key) + def config(self, **kw): + res = () + for k, v in _cnfmerge(kw).items(): + if v is not None: + if k[-1] == '_': k = k[:-1] + if callable(v): + v = self._register(v) + res = res + ('-'+k, v) + apply(self.tk.call, (self.name, 'config') + res) + configure = config def height(self): return self.tk.getint( self.tk.call('image', 'height', self.name)) -- cgit v0.12