From: Waleed Harbi Date: 2007-09-26T16:27:49+09:00 Subject: Re: how to use Ruby / Tk to display a text message status box ------=_Part_6365_15275782.1190791665292 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I wish they help you : http://httpd.chello.nl/k.vangelder/ruby/learntk/ http://phrogz.net/ProgrammingRuby/ext_tk.html http://rubylearning.com/satishtalim/ruby_tk_tutorial.html http://members.at.infoseek.co.jp/shiroikumo/ruby/rubytk/index-en.html On 9/26/07, Summercool wrote: > > > On Sep 23, 2:46 pm, SpringFlowers AutumnMoon > wrote: > > how can we pop up aTkwindow to display the temporary results of a > > program? > > > > If our program is running and displaying its intermediate calculations, > > instead of showing the final result at the end, i hope to have aTk > > window just to show the semi-final results. > > someone in the Tcl/Tk newsgroup posted a program to do that. > i don't know the exact Ruby / Tk equivalent right now, but here is the > code that will work in Perl: > > use warnings; > use strict; > use Tk qw/tkinit DoOneEvent exit DONT_WAIT ALL_EVENTS/; > use POSIX qw(strftime); > > my $mw = tkinit; > > my $text=$mw->Text()->pack(); > > > my $I; > my $J = 0; > > while (1) { > $mw->DoOneEvent( DONT_WAIT | ALL_EVENTS ); > if ( ++$I > 10000 ) { #slows things down use 1 for max speed > > $text->delete("1.0", 'end'); > $text->insert('end',"And this is GUI $J "); > my $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime; > $text->insert('end',"\ntime is $now_string "); > > print "command line $J "; > $I = 0; > $J++; > } > } > > > > > -- ==================================== Yours, Waleed Harbi Nothing without reason everything for some thing. ------=_Part_6365_15275782.1190791665292--