mirror of https://github.com/python/cpython
When setting the event structure fields, don't die when the widget
name is not registered; simply use the string. This happens for tear-off widgets (e.g. if you've registered enter/leave events for the menu).
This commit is contained in:
parent
1f41f846a3
commit
e86271af72
|
@ -585,7 +585,10 @@ class Misc:
|
|||
e.keysym = K
|
||||
e.keysym_num = tk.getint(N)
|
||||
e.type = T
|
||||
e.widget = self._nametowidget(W)
|
||||
try:
|
||||
e.widget = self._nametowidget(W)
|
||||
except KeyError:
|
||||
e.widget = W
|
||||
e.x_root = tk.getint(X)
|
||||
e.y_root = tk.getint(Y)
|
||||
return (e,)
|
||||
|
|
Loading…
Reference in New Issue