Class: Sweet::App

Inherits:
Wx::App
  • Object
show all
Includes:
Application
Defined in:
lib/sweet/wx.rb

Instance Method Summary collapse

Methods included from Application

#busy, #initialize_app, #method_missing, #perform, #sweet_containers, #var_containers

Constructor Details

#initialize(name, opts, &block) ⇒ App

Returns a new instance of App.



24
25
26
27
# File 'lib/sweet/wx.rb', line 24

def initialize(name, opts, &block)
  @name, @opts, @block = name, opts, block
  super()
end

Dynamic Method Handling

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

Instance Method Details

#on_initObject



29
30
31
32
33
34
35
# File 'lib/sweet/wx.rb', line 29

def on_init
  title = @opts[:title] || @name
  frame = Wx::Frame.new(nil, -1, title)
  initialize_app(frame)
  frame.sweeten(self, @opts, &@block)
  frame.show
end