1#
2#  tkextlib/iwidgets/mainwindow.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 Mainwindow < Tk::Iwidgets::Shell
12    end
13  end
14end
15
16class Tk::Iwidgets::Mainwindow
17  TkCommandNames = ['::iwidgets::mainwindow'.freeze].freeze
18  WidgetClassName = 'Mainwindow'.freeze
19  WidgetClassNames[WidgetClassName] ||= self
20
21  def __boolval_optkeys
22    super() << 'helpline' << 'statusline'
23  end
24  private :__boolval_optkeys
25
26  def __strval_optkeys
27    super() << 'menubarbackground' << 'menubarforeground' << 'toolbarforeground'
28  end
29  private :__strval_optkeys
30
31  def __font_optkeys
32    super() << 'menubarfont' << 'toolbarfont'
33  end
34  private :__font_optkeys
35
36  def child_site
37    window(tk_call(@path, 'childsite'))
38  end
39
40  def menubar(*args)
41    unless args.empty?
42      tk_call(@path, 'menubar', *args)
43    end
44    window(tk_call(@path, 'menubar'))
45  end
46
47  def mousebar(*args)
48    unless args.empty?
49      tk_call(@path, 'mousebar', *args)
50    end
51    window(tk_call(@path, 'mousebar'))
52  end
53
54  def msgd(*args)
55    unless args.empty?
56      tk_call(@path, 'msgd', *args)
57    end
58    window(tk_call(@path, 'msgd'))
59  end
60
61  def toolbar(*args)
62    unless args.empty?
63      tk_call(@path, 'toolbar', *args)
64    end
65    window(tk_call(@path, 'toolbar'))
66  end
67end
68