开发者

why is wish opening two windows instead of one?

In Tcl/Tk, the source of file /usr/bin/wan27

#! /usr/bin/wish -f
set w .main
toplevel $w
wm title $w "FOO"

when issuing the com开发者_运维百科mand "wan27" from terminal (Linux/Debian/Ubuntu 10.04), it opens two windows, one with the title wan27 and the other one with the title FOO. I just want the FOO window to open. How can I fulfill that?

Thanks


Use the following:

#! /usr/bin/wish -f
wm title . "FOO"


The answer is that wish always creates a window named ".". So that is one window. You then create a second window with the toplevel command so now you have two.


You can use also:

wm state . withdrawn


If you want to ignore . then you can just hide it: wm iconify .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜