我试过这个,点击鼠标关闭了窗口,但从未得到过这个事件:
top = TkToplevel.new(root)
top.bind('<Destroy>', proc {
...
})
出了什么问题?
答案 0 :(得分:1)
top = TkToplevel.new(root)
top.protocol "WM_DELETE_WINDOW", proc { puts "It's time to say goodbye.";
top.destroy }