Tk Source Code

View Ticket
Login
Ticket UUID: 3009885
Title: tk_messageBox can return empty string on Windows
Type: Bug Version: 8.6.18, 9.0.5, 9.1.0
Submitter: beric Created on: 2010-06-01 11:37:38
Subsystem: 38. [tk_messageBox] Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-14 16:17:46
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-14 16:17:46
Description:
If the parent window of a tk_messageBox is transient, and the window is iconified, the message box disappears and returns the empty string.

# Example;
package require Tk

tk_messageBox -message test   
# Iconify the application, the message dialog stay open

toplevel .t
tk_messageBox -parent .t -message test
# Iconify the application, the message dialog stay open

wm transient .t .
tk_messageBox -parent .t -message test
# Iconify the application, the message dialog disappears
# Deiconify the application, tk_messageBox returns empty string
User Comments: jan.nijtmans added on 2026-10-14 16:17:46:

Fixed in [3b64795c|trunk], core-9-0-branch and core-8-6-branch.

Many thanks!


serhiy.storchaka added on 2026-10-02 18:42:39:

Still present in 8.6 and 9.1 on Windows 11. When the master is deiconified, the wrapper window of the transient is recreated, and this destroys the message box owned by it.

Proposed fix in branch win-transient-keep-wrapper: recreate the wrapper only if it is not yet owned by the master's wrapper. New test winWm-9.4.