Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main > by-pkgid > e2a5fef11a7f55d2dc803b8b7498c8e5 > files > 687

ruby-tcltk-1.8.5-31.el5_9.x86_64.rpm

#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'

sf = Tk::Iwidgets::Scrolledframe.new(:width=>150, :height=>180, 
                                     :labeltext=>'scrolledframe')
cs = sf.child_site

TkButton.new(cs, :text=>'Hello').pack(:pady=>10)
TkButton.new(cs, :text=>'World').pack(:pady=>10)
TkButton.new(cs, :text=>'This is a test').pack(:pady=>10)
TkButton.new(cs, :text=>'This is a really big button').pack(:pady=>10)
TkButton.new(cs, :text=>'This is another really big button').pack(:pady=>10)
TkButton.new(cs, :text=>'This is the last really big button').pack(:pady=>10)

sf.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)

Tk.mainloop