在最小化主框架的同时销毁任何打开的菜单

时间:2014-07-16 09:29:26

标签: cygwin tcl tk

我在Cygwin上遇到了tcl8.5的问题 弹出菜单不会被破坏并保持粘性,同时最小化主框架

这是一个例子: 将以下代码写入pop_script.tcl文件

# Create a menu
set m [menu .popupMenu -takefocus 1]
$m add command -label "Example 1" -command bell
$m add command -label "Example 2" -command bell

# Create something to attach it to
pack [label .l -text "Click me!"]

# Arrange for the menu to pop up when the label is clicked
bind .l <3> {tk_popup .popupMenu %X %Y}
  1. 打开Cygwin shell并使用以下命令运行脚本:wish pop_script.tcl
  2. 右键单击“Click me!”标签
  3. 最小化主框架
  4. 菜单保持粘性
  5. 任何想法如何解决这个问题?

    注意: 使用Cygwin + tcl8.4无法重现问题

    我使用与Cygwin包关联的TCL而不是活动状态TCL

0 个答案:

没有答案