Module: Slapp::Sugar

Includes:
Wx
Included in:
Wx::App
Defined in:
lib/slapp.rb

Instance Method Summary collapse

Instance Method Details

#button(name, options = {}) ⇒ Object



36
37
38
# File 'lib/slapp.rb', line 36

def button name, options = {}
  elements[name] ||= Button.new elements[:frame], -1, options[:caption]
end

#elementsObject



32
33
34
# File 'lib/slapp.rb', line 32

def elements
  @elements ||= {}
end

#frame(options = {}, &block) ⇒ Object



25
26
27
28
29
30
# File 'lib/slapp.rb', line 25

def frame options = {}, &block
  elements[:frame] = Frame.new(nil, -1, options[:title])
  block.call
  elements[:frame].show
  return elements[:frame]
end