blob: 3872fb7d4066ca1ffe150371dda2f6f9c3c90ef6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/env ruby
# frozen_string_literal: false
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
|