From: Hidetoshi NAGAI Date: 2007-09-26T22:21:22+09:00 Subject: Re: how to use Ruby / Tk to display a text message status box Hi, From: SpringFlowers AutumnMoon Subject: Re: how to use Ruby / Tk to display a text message status box Date: Wed, 26 Sep 2007 21:08:44 +0900 Message-ID: <2363af4d260f503c8c1666a3236b4ad4@ruby-forum.com> > the following program can do what the Perl program can do. > right now i don't know Tk enough to check when the GUI window is closed > by the user and therefore don't do any text update. How about the following? ---------------------------------------------------------------- require 'tk' evloop = Thread.new{Tk.mainloop} text = TkText.new(Tk.root).pack i = 0 n = 10000 Tk.root.protocol(:WM_DELETE_WINDOW){ if Tk.messageBox(:type=>'okcancel', :message=>' Realy? ') == 'ok' printf "Bye ...\n" exit else #ignore end } while (text.exist? rescue false) if (i += 1) % n == 0 text.value = <