From: Hidetoshi NAGAI Date: 2007-04-03T19:14:01+09:00 Subject: Re: Multiple files/windows with Tk From: DBH Subject: Multiple files/windows with Tk Date: Sun, 1 Apr 2007 09:52:48 +0900 Message-ID: > I'm currently trying to write a Ruby program using Tk that requires the > use of multiple files and windows. For instance, I have a main screen, > and when I click on one of the buttons, I want the main window to close > and a new window to open. The code for these windows is located in > different files (but if possible I could put them all in one). So far (snip) For example, -------------------------------------------------------------------- require 'tk' root = TkRoot.new win = TkToplevel.new win.withdraw TkLabel.new(root, :text=>'This is a root window.').pack TkButton.new(root, :text=>'hide root', :command=>proc{root.withdraw; win.deiconify}).pack TkLabel.new(win, :text=>'This is a toplevel window.').pack TkButton.new(win, :text=>'hide win', :command=>proc{win.withdraw; root.deiconify}).pack Tk.mainloop -------------------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)