From: Chuck Brotman Date: 2012-07-26T14:13:10+09:00 Subject: Re: Need a simple graphics interface/function for ruby ------=_Part_166_29062574.1343279587598 Content-Type: multipart/alternative; boundary="----=_Part_167_2820861.1343279587598" ------=_Part_167_2820861.1343279587598 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Regis, Thank you for your informative reply. I'll give it a try! On Tuesday, July 24, 2012 4:16:53 AM UTC-4, Regis d'Aubarede wrote: > here a example with gtk by a littlr dsl > > ... install gtk2 > > gem install Ruiby > > and then : > > > require 'ruiby' > M=12 > N=10 > Ruiby.app width: 400, height:400 do > @matrix=[] > table(M,N) do > M.times { > line=[] > row { > N.times { > line << label(" ") > cell(line.last) > } > } > @matrix << line > } > end > anim(10) do > @matrix[rand(M)][rand(N)].text = (Time.now.to_i%10).to_s > end > end > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_167_2820861.1343279587598 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Regis,
 
Thank you for your informative reply.   I'll give it a try!
 

On Tuesday, July 24, 2012 4:16:53 AM UTC-4, Regis d'Aubarede wrote:
here a example with gtk by a littlr dsl
> ... install gtk2
> gem install Ruiby

and then :


require 'ruiby'
M=12
N=10
Ruiby.app width: 400, height:400 do
 @matrix=[]
 table(M,N) do
    M.times {
    line=[]
    row {
      N.times {
        line << label("   ")
        cell(line.last)
      }
    }
    @matrix << line
  }
 end
 anim(10) do
    @matrix[rand(M)][rand(N)].text = (Time.now.to_i%10).to_s
 end
end

--
Posted via http://www.ruby-forum.com/.

------=_Part_167_2820861.1343279587598-- ------=_Part_166_29062574.1343279587598--