Module: WidgetWrapper::Initializer
- Defined in:
- lib/wx_wrapper/initializer.rb
Instance Method Summary collapse
-
#anvil(name) ⇒ Object
Initializes the application widgets.
-
#extract_options_from_args!(args) ⇒ Object
nodoc.
-
#position_array_to_instance(options) ⇒ Object
nodoc.
-
#size_array_to_instance(options) ⇒ Object
nodoc.
-
#style_array_to_constants(options) ⇒ Object
nodoc.
Instance Method Details
#anvil(name) ⇒ Object
Initializes the application widgets.
anvil "FirstApp" do
frame "Hello World!"
end
10 11 12 13 14 |
# File 'lib/wx_wrapper/initializer.rb', line 10 def anvil(name) Wx::App.run do yield if block_given? end end |
#extract_options_from_args!(args) ⇒ Object
nodoc
16 17 18 |
# File 'lib/wx_wrapper/initializer.rb', line 16 def (args) #nodoc args.last.is_a?(Hash) ? args.pop : {} end |
#position_array_to_instance(options) ⇒ Object
nodoc
20 21 22 |
# File 'lib/wx_wrapper/initializer.rb', line 20 def position_array_to_instance() #nodoc [:position] = Wx::Point.new([:position][0], [:position][1]) unless [:position].nil? end |
#size_array_to_instance(options) ⇒ Object
nodoc
24 25 26 |
# File 'lib/wx_wrapper/initializer.rb', line 24 def size_array_to_instance() #nodoc [:size] = Wx::Size.new([:size][0], [:size][1]) unless [:size].nil? end |
#style_array_to_constants(options) ⇒ Object
nodoc
28 29 30 |
# File 'lib/wx_wrapper/initializer.rb', line 28 def style_array_to_constants() #nodoc [:style] = eval([:style].collect { |key| "Wx::TE_#{key.to_s.upcase}" }.join('|')) unless [:style].nil? end |