summaryrefslogtreecommitdiff
path: root/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
blob: 74684974b113fc48202aab4c65c0f11b7b5dd726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'

TkOption.add('*textBackground', 'white')

sb = Tk::Iwidgets::Selectionbox.new.pack(:padx=>10, :pady=>10,
                                         :fill=>:both, :expand=>true)

sb.insert_items('end', *['Hello', 'Out There', 'World'])

TkLabel.new(sb.child_site,
            :text=>'Child Site is Here').pack(:fill=>:x, :padx=>10, :pady=>10)

sb.insert_items(2, 'Cruel Cruel')

sb.selection_set(1)

Tk.mainloop