Title: tkinter.messagebox and tkinter.filedialog don't show default button's keyboard shortcuts
Type: enhancement Stage:
Components: Tkinter Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jcrmatos, serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2017-09-11 17:38 by jcrmatos, last changed 2017-09-28 04:32 by terry.reedy.

Messages (8)
msg301893 - (view) Author: (jcrmatos) * Date: 2017-09-11 17:38
tkinter.messagebox windows (eg. askokcancel, showerror, showinfo, ...) in Tkinter 8.6 running on Python 3.5.3, don't don't show the keyboard shortcuts/accelerators in the default buttons.

And the askopenfilename from tkinter.filedialog only shows the Open one. The Cancel does not appear and does not work.

I'm using it under Windows 7 Pro.
msg302280 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-15 17:41
Not showing shortcuts is not a bug in the strick sense used on the tracker.  Please be more specific about what it is that is not working.
msg302282 - (view) Author: (jcrmatos) * Date: 2017-09-15 18:03

I can't be more specific.

The problem is that the tkinter.messagebox windows (askokcancel, askyesno, showerror, showinfo, etc.) default buttons (Ok, Cancel, Yes, No, etc.) don't show the default keyboard shortcuts/accelerators.
I believe they should. Is it an incorrect assumpption?


msg303167 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-27 18:28
Would be help if you provide a minimal script that exposes the problem.
msg303170 - (view) Author: (jcrmatos) * Date: 2017-09-27 19:13

Here it is.

from tkinter import Tk
from tkinter.messagebox import askokcancel, showerror

showerror('Error', 'Error message', parent=master)
a = askokcancel('Error', 'Error message', parent=master)

Best regards,

msg303172 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-27 19:31
These are standard Tk widgets. Tkinter is not responsible for the look and feel of them. It just call the Tk command tk_messageBox with corresponding parameters [1].

msg303181 - (view) Author: (jcrmatos) * Date: 2017-09-27 21:27

There are no parameters for the buttons.

There is a difference in behaviour between messagebox windows (no shortcuts at all) to askopenfilename from tkinter.filedialog where the Open button has teh shortcut (but the Cancel one doesn't).

Best regards,

msg303191 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-28 04:31
jcr: 3.5 only gets security fixes.  If this issue does not apply to 3.6 or 3.7, this should be closed.  When core developers (snake after name) change the headers, you should assume that they know what they are doing and not change them back.
Date User Action Args
2017-09-28 04:32:02terry.reedysetversions: - Python 3.5
2017-09-28 04:31:44terry.reedysetmessages: + msg303191
2017-09-27 21:27:13jcrmatossetmessages: + msg303181
2017-09-27 19:31:58serhiy.storchakasetmessages: + msg303172
2017-09-27 19:13:24jcrmatossetmessages: + msg303170
2017-09-27 18:28:59serhiy.storchakasetmessages: + msg303167
2017-09-27 17:11:24jcrmatossetversions: + Python 3.5, - Python 3.7
2017-09-15 18:03:54jcrmatossetmessages: + msg302282
2017-09-15 17:41:00terry.reedysetversions: + Python 3.7, - Python 3.5
nosy: + terry.reedy, serhiy.storchaka

messages: + msg302280

type: behavior -> enhancement
2017-09-11 17:38:18jcrmatoscreate