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.

Title: macOS tkinter Save As doesn't accept keyboard shortcuts
Type: behavior Stage: resolved
Components: macOS, Tkinter Versions: Python 3.10, Python 3.9
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: epaine, jacobtylerwalls, ned.deily, ronaldoussoren, terry.reedy
Priority: normal Keywords:

Created on 2021-03-15 01:40 by jacobtylerwalls, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg388699 - (view) Author: Jacob Walls (jacobtylerwalls) * Date: 2021-03-15 01:40
Cmd-A to select all or Cmd-Z to undo, etc., have no effect when typing in the "Save As:" or "Tags:" fields of the native Save As... dialog on MacOS. Cmd-R, curiously, opens a Finder window.

IDLE dialogs such as Search behave as expected (Cmd-A selects all).

Python 3.9.2
macOS 10.15.7 (and 10.13.6)

Pardon me if my search for existing tickets came up short.
msg388708 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-03-15 05:26
The menu items and Windows shortcuts work on Windows 10.  Several shortcuts and some menu items do not work on macOS.  The latter is true for the undo and clipboard  items at the top of the Edit menu.  The shortcuts do cause 'Edit' to flash, indicating that the shortcut was recognized and suggesting that the corresponding event handler was called.

If so, this is not obviously an IDLE issue.  IDLE calls tkinter.filedialog.SaveAs.  IDLE does nothing with its key bindings and I do not believe it could.  Tkinter calls tk_getSaveFile.  So this might instead be a tkinter or tcl/tk issue.

To decide, someone should write a short IDLE-free tkinter program that calls the tkinter SaveAs function.  If that fails, a wish tk program could be tested.
msg388719 - (view) Author: E. Paine (epaine) * Date: 2021-03-15 09:53
This is reproducible using tkinter in Python 3.9.2 installed using both the regular Intel and Universal2 installers. It is also reproducible in Wish 8.6.10. (tested on MacOS 11.2.1)
msg388752 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-03-15 17:31
Thank you, EP, for being 'someone'.  I should remember that you are the one who can current do these tests.  I presume the reproducible 'this' is the non-response to cmd-A, cmd-Z, and so on.  So closing as 3rd party, tcl/tk, issue.

I comfirmed that Jacob's expectation is reasonable in that the keys do work in the macOS save-as dialog opened from Safari (and I presume in other Apple-supplied apps).

The tk doc says merely "pop up a dialog box for the user to select a file to open or save." Some details are system-specific.  The only promise about user interaction is that one can enter a new name when saving and either confirm or cancel.

The tkinter doc adds "native look-and-feel", but this is an interpretation of the intention of the tk function and is completely dependent on them.  Any failure of the 'feel' part should be reported to tk.  (The IDLE doc merely says "with a Save As dialog".)

The IDLE Edit menu only applies to its editable text windows.  Their menus are grayed out for modal dialogs.  Tkinter dialog entry boxes come with selection and clipboard hot keys, but not undo keys.
Date User Action Args
2022-04-11 14:59:42adminsetgithub: 87662
2021-03-15 17:31:50terry.reedysetstatus: open -> closed
title: Save As dialog in IDLE doesn't accept keyboard shortcuts on MacOS -> macOS tkinter Save As doesn't accept keyboard shortcuts
messages: + msg388752

resolution: third party
stage: resolved
2021-03-15 09:53:10epainesetnosy: + epaine
messages: + msg388719
components: - IDLE
2021-03-15 05:26:59terry.reedysetassignee: terry.reedy ->
messages: + msg388708
components: + Tkinter
versions: + Python 3.10
2021-03-15 01:40:29jacobtylerwallscreate