Commit 8371013f authored by Guido van Rossum's avatar Guido van Rossum

Added config(ure) method to Image class.

(Fred Drake)
parent 0b96b945
......@@ -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))
......
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment