1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/sample/tkextlib/tile/demo.rb: added combobox demo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-08-01 06:35:15 +00:00
parent 6a7659309d
commit 9aab7083a8
2 changed files with 25 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2005-08-01 ocean <ocean@ruby-lang.org>
* sample/tkextlib/tile/demo.rb: added combobox demo.
2005-07-27 ocean <ocean@ruby-lang.org> 2005-07-27 ocean <ocean@ruby-lang.org>
* sample/tkextlib/tile/demo.rb: fixed typo. * sample/tkextlib/tile/demo.rb: fixed typo.

View file

@ -301,6 +301,8 @@ def makeNotebook
nb.add(client, :text=>'Demo', :underline=>0) nb.add(client, :text=>'Demo', :underline=>0)
nb.select(client) nb.select(client)
combo = Tk::Tile::TFrame.new(nb)
nb.add(combo, :text=>'Combobox', :underline=>7)
others = Tk::Tile::TFrame.new(nb) others = Tk::Tile::TFrame.new(nb)
nb.add(others, :text=>'Others', :underline=>4) nb.add(others, :text=>'Others', :underline=>4)
nb.add(Tk::Tile::TLabel.new(nb, :text=>'Nothing to see here...'), nb.add(Tk::Tile::TLabel.new(nb, :text=>'Nothing to see here...'),
@ -308,10 +310,10 @@ def makeNotebook
nb.add(Tk::Tile::TLabel.new(nb, :text=>'Nothing to see here either.'), nb.add(Tk::Tile::TLabel.new(nb, :text=>'Nothing to see here either.'),
:text=>'More Stuff', :sticky=>:se) :text=>'More Stuff', :sticky=>:se)
[nb, client, others] [nb, client, combo, others]
end end
nb, client, others = makeNotebook() nb, client, combo, others = makeNotebook()
# #
# Side-by side check, radio, and menu button comparison: # Side-by side check, radio, and menu button comparison:
@ -536,6 +538,23 @@ menu.add(:cascade, :label=>'Theme', :underline=>3,
setTheme($V[:THEME]) setTheme($V[:THEME])
#
# Combobox demo pane:
#
values = %w(list abc def ghi jkl mno pqr stu vwx yz)
2.times {|i|
cb = Tk::Tile::TCombobox.new(
combo, :values=>values, :textvariable=>$V.ref(:COMBO))
cb.pack(:side=>:top, :padx=>2, :pady=>2, :expand=>false, :fill=>:x)
if i == 1
cb.state :readonly
begin
cb.current = 3 # ignore if unsupported (tile0.4)
rescue
end
end
}
# #
# Other demos: # Other demos:
# #