Terry J. Reedy added the comment:
While writing #27620 and adding a binding to Query for <Escape>, a few hours
ago, I realized that this would be the case, that it could be considered a bug,
and that the fix will be a 'return' function that looks at the focus before
invoking [Ok] (the default) or [Cancel] (when it has the focus).
def return_key(self, event):
if self.focus_get() == self.button_cancel:
self.cancel()
else:
self.ok()
appears to work. I will push tomorrow after writing a test. Something similar
is needed for config dialog. I just tested the search dialog and it behaves
the same as query does now. If one tabs enough to put the focus on close,
<Return> does find anyway.
Do you agree that Esc should always cancel regardless of where the focus is? I
would appreciate your input on #27620 as to the 'right' behavior we should aim
at for the different dialogs.
While I think of it, the indication of ttk.Entry focus with the default Windows
theme is a shift of the 1 pixel black border to a 1 pixel blue border. It is
not obvious. I want to look as other Window's theme or possibly a custom
style. Now a priority yet.
----------
stage: -> test needed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27621>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com