Class: IPlayer::GUI::Frame::SizerProxy
- Inherits:
-
Object
- Object
- IPlayer::GUI::Frame::SizerProxy
- Defined in:
- lib/iplayer/gui/frame.rb
Instance Method Summary collapse
-
#initialize(frame, sizer) ⇒ SizerProxy
constructor
A new instance of SizerProxy.
- #method_missing(method, *args, &blk) ⇒ Object
Constructor Details
#initialize(frame, sizer) ⇒ SizerProxy
Returns a new instance of SizerProxy.
12 13 14 |
# File 'lib/iplayer/gui/frame.rb', line 12 def initialize(frame, sizer) @frame, @sizer = frame, sizer end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &blk) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/iplayer/gui/frame.rb', line 16 def method_missing(method, *args, &blk) default_border = case method when :h_sizer, :v_sizer 0 else 4 end = args.last.is_a?(Hash) ? args.pop : {} proportion = .delete(:proportion) || 0 flags = .delete(:flags) || Wx::ALL border = .delete(:border) || default_border args << unless .empty? control = @frame.__send__(method, *args, &blk) @sizer.add(control, proportion, flags, border) control end |