aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
blob: f825483b2ce82434851078bec12c381e46871db9 (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'

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

sh = Tk::Iwidgets::Scrolledhtml.new(:fontname=>'helvetica',
                                    :linkcommand=>proc{|href|
                                      sh.import_link(href)
                                    })
sh.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)

sh.import(Tk.getOpenFile(:title=>'select HTML document'))

Tk.mainloop