summaryrefslogtreecommitdiffstats
path: root/ext/tk/sample
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-01 06:35:15 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-01 06:35:15 +0000
commit77cf0caab7ef7154167f1e483e0fd17066004a6e (patch)
tree5b2a8f4e9d1a909d52237c0932714369bb7bd3eb /ext/tk/sample
parent1a1c56a5b3f175d1aa90e5c06b0de131c9cf9676 (diff)
downloadruby-77cf0caab7ef7154167f1e483e0fd17066004a6e.tar.gz
ruby-77cf0caab7ef7154167f1e483e0fd17066004a6e.tar.xz
ruby-77cf0caab7ef7154167f1e483e0fd17066004a6e.zip
* ext/tk/sample/tkextlib/tile/demo.rb: added combobox demo.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample')
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb23
1 files changed, 21 insertions, 2 deletions
diff --git a/ext/tk/sample/tkextlib/tile/demo.rb b/ext/tk/sample/tkextlib/tile/demo.rb
index a0cbb4790..d6673f3bd 100644
--- a/ext/tk/sample/tkextlib/tile/demo.rb
+++ b/ext/tk/sample/tkextlib/tile/demo.rb
@@ -301,6 +301,8 @@ def makeNotebook
nb.add(client, :text=>'Demo', :underline=>0)
nb.select(client)
+ combo = Tk::Tile::TFrame.new(nb)
+ nb.add(combo, :text=>'Combobox', :underline=>7)
others = Tk::Tile::TFrame.new(nb)
nb.add(others, :text=>'Others', :underline=>4)
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.'),
:text=>'More Stuff', :sticky=>:se)
- [nb, client, others]
+ [nb, client, combo, others]
end
-nb, client, others = makeNotebook()
+nb, client, combo, others = makeNotebook()
#
# Side-by side check, radio, and menu button comparison:
@@ -537,6 +539,23 @@ menu.add(:cascade, :label=>'Theme', :underline=>3,
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:
#
$Timers = {:StateMonitor=>nil, :FocusMonitor=>nil}