mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Added config(ure) method to Image class.
(Fred Drake)
This commit is contained in:
parent
0b96b945b8
commit
8371013f9a
2 changed files with 20 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue