Module: Builder::Gtk::LayoutProxy
- Included in:
- BoxProxy, WindowProxy
- Defined in:
- lib/proxies/layout.rb
Overview
Base class for all widgets that can have children
Instance Attribute Summary collapse
-
#widget ⇒ Object
The widget that is being proxied.
Instance Method Summary collapse
-
#method_missing(name, *args, &block) ⇒ Object
Handles constructing Gtk widgets.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
Handles constructing Gtk widgets
Example:
proxy.entry --> Gtk::Entry.new
proxy.vbox(true, 10) --> Gtk::VBox.new(true, 10)
proxy.drawing_area --> Gtk::DrawingArea.new
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/proxies/layout.rb', line 24 def method_missing(name, *args, &block) if @widget.respond_to?(name) return @widget.__send__(name, *args, &block) end = (name, args) proxy = _get_proxy(name, ) block.call(proxy) if block () return self end |
Instance Attribute Details
#widget ⇒ Object
The widget that is being proxied
9 10 11 |
# File 'lib/proxies/layout.rb', line 9 def @widget end |