1#
2#  tkextlib/iwidgets/scrolledhtml.rb
3#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
4#
5
6require 'tk'
7require 'tkextlib/iwidgets.rb'
8
9module Tk
10  module Iwidgets
11    class Scrolledhtml < Tk::Iwidgets::Scrolledtext
12    end
13  end
14end
15
16class Tk::Iwidgets::Scrolledhtml
17  TkCommandNames = ['::iwidgets::scrolledhtml'.freeze].freeze
18  WidgetClassName = 'Scrolledhtml'.freeze
19  WidgetClassNames[WidgetClassName] ||= self
20
21  def __boolval_optkeys
22    super() << 'update'
23  end
24  private :__boolval_optkeys
25
26  def __strval_optkeys
27    super() << 'fontname' << 'link' << 'alink' << 'textbackground'
28  end
29  private :__strval_optkeys
30
31  def __font_optkeys
32    super() << 'fixedfont'
33  end
34  private :__font_optkeys
35
36  def import(href)
37    tk_call(@path, 'import', href)
38    self
39  end
40
41  def import_link(href)
42    tk_call(@path, 'import', '-link', href)
43    self
44  end
45
46  def pwd
47    tk_call(@path, 'pwd')
48  end
49
50  def render(htmltext, workdir=None)
51    tk_call(@path, 'render', htmltext, workdir)
52    self
53  end
54
55  def title
56    tk_call(@path, 'title')
57  end
58end
59