~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/tk/lib/tkextlib/iwidgets/messagebox.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#  tkextlib/iwidgets/messagebox.rb
 
3
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
 
4
#
 
5
 
 
6
require 'tk'
 
7
require 'tkextlib/iwidgets.rb'
 
8
 
 
9
module Tk
 
10
  module Iwidgets
 
11
    class Messagebox < Tk::Iwidgets::Scrolledwidget
 
12
    end
 
13
  end
 
14
end
 
15
 
 
16
class Tk::Iwidgets::Messagebox
 
17
  TkCommandNames = ['::iwidgets::messagebox'.freeze].freeze
 
18
  WidgetClassName = 'Messagebox'.freeze
 
19
  WidgetClassNames[WidgetClassName] = self
 
20
 
 
21
  ####################################
 
22
 
 
23
  include TkItemConfigMethod
 
24
 
 
25
  def __item_cget_cmd(id)
 
26
    [self.path, 'type', 'cget', id]
 
27
  end
 
28
  private :__item_cget_cmd
 
29
 
 
30
  def __item_config_cmd(id)
 
31
    [self.path, 'type', 'configure', id]
 
32
  end
 
33
  private :__item_config_cmd
 
34
 
 
35
  def tagid(tagOrId)
 
36
    if tagOrId.kind_of?(Tk::Itk::Component)
 
37
      tagOrId.name
 
38
    else
 
39
      #_get_eval_string(tagOrId)
 
40
      tagOrId
 
41
    end
 
42
  end
 
43
 
 
44
  def __item_boolval_optkeys(id)
 
45
    super(id) << 'bell' << 'show'
 
46
  end
 
47
  private :__item_boolval_optkeys
 
48
 
 
49
  alias typecget itemcget
 
50
  alias typeconfigure itemconfigure
 
51
  alias typeconfiginfo itemconfiginfo
 
52
  alias current_typeconfiginfo current_itemconfiginfo
 
53
 
 
54
  private :itemcget, :itemconfigure
 
55
  private :itemconfiginfo, :current_itemconfiginfo
 
56
 
 
57
  ####################################
 
58
 
 
59
  def __strval_optkeys
 
60
    super() << 'filename' << 'savedir'
 
61
  end
 
62
  private :__strval_optkeys
 
63
 
 
64
  def type_add(tag=nil, keys={})
 
65
    if tag.kind_of?(Hash)
 
66
      keys = tag
 
67
      tag = nil
 
68
    end
 
69
    unless tag
 
70
      tag = Tk::Itk::Component.new(self)
 
71
    end
 
72
    tk_call(@path, 'type', 'add', tagid(tag), *hash_kv(keys))
 
73
    tag
 
74
  end
 
75
 
 
76
  def clear
 
77
    tk_call(@path, 'clear')
 
78
    self
 
79
  end
 
80
 
 
81
  def export(file)
 
82
    tk_call(@path, 'export', file)
 
83
    self
 
84
  end
 
85
 
 
86
  def issue(string, type=None, *args)
 
87
    tk_call(@path, 'issue', string, tagid(type), *args)
 
88
    self
 
89
  end
 
90
 
 
91
end