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

mainloop = Thread.new{Tk.mainloop}

st = Tk::Iwidgets::Scrolledtext.new.pack
st.insert('end', "Now is the time for all good men\n")
st.insert('end', "to come to the aid of their country")

fd = Tk::Iwidgets::Finddialog.new(:textwidget=>st)
fd.center(st)
fd.activate

mainloop.join