Module: WidgetWrapper::Menus::Frame
- Defined in:
- lib/wx_wrapper/menu.rb
Instance Method Summary collapse
- #create_menu_events(menu_bar) ⇒ Object
-
#menu_bar {|new_menu_bar| ... } ⇒ Object
Creates a menu bar for the frame.
-
#menu_item_label_to_method(label) ⇒ Object
Returns names for menu items prefixed with on_.
Instance Method Details
#create_menu_events(menu_bar) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/wx_wrapper/menu.rb', line 17 def () ..each do || .items.each do |item| (item.get_id) { send((item.get_label)) } end end end |
#menu_bar {|new_menu_bar| ... } ⇒ Object
Creates a menu bar for the frame. Example syntax:
frame. do ||
. do ||
end
end
10 11 12 13 14 15 |
# File 'lib/wx_wrapper/menu.rb', line 10 def = Wx::MenuBar.new yield() if block_given? () () end |
#menu_item_label_to_method(label) ⇒ Object
Returns names for menu items prefixed with on_. ie on_save
26 27 28 |
# File 'lib/wx_wrapper/menu.rb', line 26 def (label) 'on_' + label.downcase.gsub(/[^a-zA-Z0-9 ]/, '').gsub(/[ ]/, '_') end |