From: Guido van Rossum Date: Fri, 27 Dec 1996 15:33:17 +0000 (+0000) Subject: Added config(ure) method to Image class. X-Git-Tag: v1.5a1~643 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8371013f9a50cf0fb38ba39dce1d83c6543ce9d3;p=python Added config(ure) method to Image class. (Fred Drake) --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 1e49f6e2d8..286a55719f 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 1e49f6e2d8..286a55719f 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))