Class: RubyMVC::Views::PeerView
- Inherits:
-
View
- Object
- Toolkit::AbstractWidget
- View
- RubyMVC::Views::PeerView
- Defined in:
- lib/ruby_mvc/views/view.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#frame ⇒ Object
This method is used to retrieve a reference to the parent frame.
-
#widget ⇒ Object
Returns the value of attribute widget.
Attributes inherited from View
Attributes included from ActionProvider
Class Method Summary collapse
- .create_widget(klass, options = {}) ⇒ Object
-
.widget(*args, &block) ⇒ Object
This method is used to define the primary widget class through which this view may be added to other widgets.
- .widget_def(targ = nil) ⇒ Object
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PeerView
constructor
A new instance of PeerView.
- #method_missing(m, *a, &b) ⇒ Object
- #peer ⇒ Object
-
#signal_connect(signal, &b) ⇒ Object
This method is required to ensure that concrete views appropriately manage signal registration.
- #signal_disconnect(signal, &b) ⇒ Object
Methods included from ActionProvider
Methods included from Toolkit::SignalHandler::ClassMethods
#signal, #signals, #valid_signal!, #valid_signal?
Methods included from Toolkit::SignalHandler
Constructor Details
#initialize(options = {}) ⇒ PeerView
Returns a new instance of PeerView.
87 88 89 90 |
# File 'lib/ruby_mvc/views/view.rb', line 87 def initialize( = {}) super = PeerView.(self.class, ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *a, &b) ⇒ Object
113 114 115 |
# File 'lib/ruby_mvc/views/view.rb', line 113 def method_missing(m, *a, &b) .send(m, *a, &b) end |
Instance Attribute Details
#frame ⇒ Object
This method is used to retrieve a reference to the parent frame
84 85 86 |
# File 'lib/ruby_mvc/views/view.rb', line 84 def frame @frame end |
#widget ⇒ Object
Returns the value of attribute widget.
86 87 88 |
# File 'lib/ruby_mvc/views/view.rb', line 86 def end |
Class Method Details
.create_widget(klass, options = {}) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/ruby_mvc/views/view.rb', line 60 def self.(klass, = {}) w = self.(klass) args = (w[:args].clone << ) block = w[:block] args[0].new(*args[1..-1], &block) end |
.widget(*args, &block) ⇒ Object
This method is used to define the primary widget class through which this view may be added to other widgets.
72 73 74 75 |
# File 'lib/ruby_mvc/views/view.rb', line 72 def (*args, &block) # puts "Set widget for #{self}: #{args.inspect}" = { :args => args, :block => block } end |
.widget_def(targ = nil) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ruby_mvc/views/view.rb', line 46 def self.(targ = nil) if targ == nil else if (x = targ.).nil? if targ != RubyMVC::Views::PeerView self.(targ.superclass) end else x end end end |
Instance Method Details
#peer ⇒ Object
78 79 80 |
# File 'lib/ruby_mvc/views/view.rb', line 78 def peer .peer end |
#signal_connect(signal, &b) ⇒ Object
This method is required to ensure that concrete views appropriately manage signal registration
95 96 97 98 99 100 101 102 103 |
# File 'lib/ruby_mvc/views/view.rb', line 95 def signal_connect(signal, &b) # puts "Widget class: #{@widget.class}" if .class.valid_signal? signal .signal_connect(signal, &b) else # puts "super" super end end |
#signal_disconnect(signal, &b) ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/ruby_mvc/views/view.rb', line 105 def signal_disconnect(signal, &b) if .class.valid_signal? signal .signal_connect(signal, &b) else super end end |