简体   繁体   中英

tk_messageBox is showing erroneous display in grid view, but ok in pack

I am trying to display a message box in TCL/TK and it is expected to be closed to perform any operation in parent window. When I execute the below code, the text box is going to the "disabled" state even after clearing the message box.

wm title . "Message Box Demo"

tk::text .t0

grid .t0 -column 0 -row 1 -columnspan 2

tk_messageBox -type okcancel  -message "Press Ok to confirm" \
    -title "Update V 3.6" -icon "info"

If I introduce TopLevel to include "parent' window in messageBox, it is opening a new window as top-level window and allowing to access the text box.

wm title . "Message Box Demo"

toplevel .top1
tk::text .t0

grid .t0 -column 0 -row 1 -columnspan 2

tk_messageBox -type okcancel -parent .top1 -message "Press Ok to confirm" \
    -title "Update V 3.6" -icon "info"

can someone help me to identify what is wrong here?

Recreated on windows. This does appear to be a bug and I have opened a ticket for it.

You can do:

 toplevel .top1
 wm withdraw .top1

to hide the .top1 window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM