0
我是Ruby的新手。我能夠創建一個簡單確定一個簡單的窗口/取消按鈕用下面的代碼和它的作品:使用Ruby關閉TK窗口
require 'tk'
root = TkRoot.new
root.title = "Window"
msgBox = Tk.messageBox(
'type' => "okcancel",
'icon' => "info",
'title' => "Framework",
'message' => "This is message"
)
Tk.mainloop #No operation is performed until closing the TK window
Tk.destroy()
Tk.exit()
雖然我可以手動關閉該窗口,我不能讓窗口關閉程序。有任何想法嗎?