This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients serhiy.storchaka, terry.reedy
Date 2016-07-26.07:11:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469517094.72.0.712200508525.issue27621@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-07-26 07:11:34terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2016-07-26 07:11:34terry.reedysetmessageid: <1469517094.72.0.712200508525.issue27621@psf.upfronthosting.co.za>
2016-07-26 07:11:34terry.reedylinkissue27621 messages
2016-07-26 07:11:34terry.reedycreate