Message271341
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. |
|
Date |
User |
Action |
Args |
2016-07-26 07:11:34 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka |
2016-07-26 07:11:34 | terry.reedy | set | messageid: <1469517094.72.0.712200508525.issue27621@psf.upfronthosting.co.za> |
2016-07-26 07:11:34 | terry.reedy | link | issue27621 messages |
2016-07-26 07:11:34 | terry.reedy | create | |
|