OSDN Git Service

Memo update for version 0.5.6.2
[molby/Molby.git] / Scripts / dialog.rb
1 #
2 #  dialog.rb
3 #
4 #  Created by Toshi Nagata on 2008/06/27.
5 #  Copyright 2008 Toshi Nagata. All rights reserved.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation version 2 of the License.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 class Dialog
17
18   def self.run(*args, &block)
19     obj = Dialog.new(*args)
20     obj.instance_eval(&block)
21     obj.run
22   end
23
24   alias initialize_orig initialize
25
26   def initialize(*args, &block)
27     initialize_orig(*args)
28         instance_eval(&block) if block
29   end
30
31   def value(tag)
32     attr(tag, :value)
33   end
34   
35   def set_value(tag, value)
36     set_attr(tag, :value=>value)
37         value
38   end
39   
40 end