Class: Fox::Object

Inherits:
BasicObject
Includes:
Sweet::Component
Defined in:
lib/sweet/fox/object.rb

Instance Attribute Summary

Attributes included from Sweet::Component

#app

Instance Method Summary collapse

Methods included from Sweet::Component

#append, included, #meta, #method_missing, #options=, #perform, #sweeten

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sweet::Component

Instance Method Details

#handle_event(evt, &block) ⇒ Object



4
5
6
7
8
# File 'lib/sweet/fox/object.rb', line 4

def handle_event(evt, &block)
  send evt, get_id do |event|
    block.call
  end
end

#layout=(layout) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/sweet/fox/object.rb', line 10

def layout=(layout)
  l = case layout
  when :flow
    Wx::BoxSizer.new(Wx::HORIZONTAL)
  when :stack
    Wx::BoxSizer.new(Wx::VERTICAL)
  end
  set_sizer l
end