我正在尝试在TCL / TK中显示一个消息框,预计将关闭该消息框以在父窗口中执行任何操作。当我执行以下代码时,即使清除了消息框,文本框也会进入“禁用”状态。
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"
如果我引入TopLevel以便在messageBox中包含“父”窗口,它将打开一个新窗口作为顶级窗口并允许访问该文本框。
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"
有人可以帮我找出这是哪里错吗?
在Windows上重新创建。这似乎是一个错误,我为此打开了一张票。
您可以做:
toplevel .top1
wm withdraw .top1
隐藏.top1窗口。