[tk_messageBox在网格视图中显示了错误的显示,但在包装中没问题

问题描述 投票:1回答:1

我正在尝试在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"

有人可以帮我找出这是哪里错吗?

grid tcl tk toplevel tkmessagebox
1个回答
0
投票

在Windows上重新创建。这似乎是一个错误,我为此打开了一张票。

您可以做:

 toplevel .top1
 wm withdraw .top1

隐藏.top1窗口。

© www.soinside.com 2019 - 2024. All rights reserved.