summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib-tk')
-rwxr-xr-xLib/lib-tk/Tix.py2
-rw-r--r--Lib/lib-tk/Tkinter.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py
index ad6126a..970e7ae 100755
--- a/Lib/lib-tk/Tix.py
+++ b/Lib/lib-tk/Tix.py
@@ -390,7 +390,7 @@ class TixWidget(Tkinter.Widget):
elif kw: cnf = kw
options = ()
for k, v in cnf.items():
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
options = options + ('-'+k, v)
return master.tk.call(('image', 'create', imgtype,) + options)
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 248a702..5a73ca8 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -1053,7 +1053,7 @@ class Misc:
for k, v in cnf.items():
if v is not None:
if k[-1] == '_': k = k[:-1]
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
res = res + ('-'+k, v)
return res
@@ -1570,7 +1570,7 @@ class Wm:
"""Bind function FUNC to command NAME for this widget.
Return the function bound to NAME if None is given. NAME could be
e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW"."""
- if callable(func):
+ if hasattr(func, '__call__'):
command = self._register(func)
else:
command = func
@@ -3221,7 +3221,7 @@ class Image:
elif kw: cnf = kw
options = ()
for k, v in cnf.items():
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
options = options + ('-'+k, v)
self.tk.call(('image', 'create', imgtype, name,) + options)
@@ -3244,7 +3244,7 @@ class Image:
for k, v in _cnfmerge(kw).items():
if v is not None:
if k[-1] == '_': k = k[:-1]
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
res = res + ('-'+k, v)
self.tk.call((self.name, 'config') + res)