HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.2.10/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'

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

slb = Tk::Iwidgets::Scrolledlistbox.new(:selectmode=>:single,
                                        :vscrollmode=>:static,
                                        :hscrollmode=>:dynamic,
                                        :labeltext=>'List',
                                        :selectioncommand=>proc{
                                          puts(slb.get_curselection)
                                        },
                                        :dblclickcommand=>proc{
                                          puts('Double Click')
                                          puts(slb.get_curselection)
                                        })
slb.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)

slb.insert('end', *['Hello', 'Out There', 'World'])

Tk.mainloop