Implement ActionList::Entry#clear.
[kaya.git] / lib / view.rb
blobaf4fb74d2f4262372f9049d272de87acb07ab7eb
1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 class View
9   include Observable
10   
11   attr_reader :controller, :movelist, :table
12   
13   def initialize(table, controller, movelist)
14     @table = table
15     @controller = controller
16     @movelist = movelist
17     @closed = false
18     
19     @controller.on(:activity) { fire :activity => self }
20     @controller.on(:dirty) { fire :dirty => self }
21   end
22   
23   def main_widget
24     @table
25   end
26   
27   def close
28     @closed = true
29     fire :close
30   end
31   
32   def closed?
33     @closed
34   end
35 end