From: "Albert L. Wagner" Date: 2002-03-28T00:50:29+09:00 Subject: Re: Error calling Tk in a loop There really should be only one instance of TkRoot. That's why it's called Root. Tk.mainloop should only be called once. The code below is still wrong because TkRoot is called 3 times. the second two calls are apparently ignored. I tried to leave it as close to what you had as possible, but the statement root = TkRoot... should really be in Main.initialize. Tk is event driven. You need to capture some mouse/keyboard events in Main that popup your alert box in the callback. You haven't defined an alert box, but rather the main application window and three labels to that window. require 'tk' class AlertBox def initialize( caption, box_text ) root = TkRoot.new { title caption } TkLabel.new(root) { text box_text pack { padx 25 ; pady 25; side 'left' } } end end class Main def initialize 1.upto(3){ |x| AlertBox.new( "Alert #{x}", "This is #{x}") } end end if __FILE__ == $0 Main.new Tk.mainloop end -- "It requires wisdom to understand wisdom: the music is nothing if the audience is deaf." - Walter Lippman