1#
2#  tkextlib/tcllib/scrolledwindow.rb
3#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
4#
5#   * Part of tcllib extension
6#   * scrolledwindow widget
7#
8
9require 'tk'
10require 'tkextlib/tcllib.rb'
11
12# TkPackage.require('widget::scrolledwindow', '1.2')
13TkPackage.require('widget::scrolledwindow')
14
15module Tk::Tcllib
16  module Widget
17    class Scrolledwindow < Tk::Tile::TFrame
18      PACKAGE_NAME = 'widget::scrolledwindow'.freeze
19      def self.package_name
20        PACKAGE_NAME
21      end
22
23      def self.package_version
24        begin
25          TkPackage.require('widget::scrolledwindow')
26        rescue
27          ''
28        end
29      end
30    end
31    ScrolledWindow = Scrolledwindow
32  end
33end
34
35class Tk::Tcllib::Widget::ScrolledWindow
36  TkCommandNames = ['::widget::scrolledwindow'.freeze].freeze
37
38  def create_self(keys)
39    if keys and keys != None
40      tk_call_without_enc(self.class::TkCommandNames[0], @path,
41                          *hash_kv(keys, true))
42    else
43      tk_call_without_enc(self.class::TkCommandNames[0], @path)
44    end
45  end
46  private :create_self
47
48  def getframe
49    window(tk_send_without_enc('getframe'))
50  end
51  alias get_frame getframe
52
53  def setwidget(w)
54    window(tk_send_without_enc('setwidget', w))
55  end
56  alias set_widget setwidget
57end
58