Class: XRC2Ruby::ObjectTypes::Menu
- Includes:
- Parent
- Defined in:
- lib/wx_sugar/xrc/xrc2ruby_types/menu.rb
Constant Summary
Constants inherited from Window
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
Attributes included from Parent
#children, #main_sizer, #sizer_items
Attributes inherited from Window
#bg, #enabled, #exstyle, #fg, #help, #hidden, #tooltip
Attributes inherited from Object
#centered, #name, #parent, #sub_class, #win_class
Instance Method Summary collapse
Methods included from Parent
#add_child, #child_output, #named_windows, #size_child
Methods inherited from Window
Methods included from InitArgs
#inherited, #init_arg, #init_args, #translatable_string_init_arg
Methods inherited from Object
#initialize, #inspect, next_id, #var_name
Constructor Details
This class inherits a constructor from XRC2Ruby::ObjectTypes::Object
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
13 14 15 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/menu.rb', line 13 def label @label end |
Instance Method Details
#output ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/wx_sugar/xrc/xrc2ruby_types/menu.rb', line 15 def output if XRC2Ruby.use_gettext the_label = "_(" + label.inspect + ")" else the_label = label.inspect end # A standard menu attached to menubar; NB - call to append must # come after all menu items have been created if parent.kind_of?(MenuBar) "#{var_name} = Wx::Menu.new\n" + child_output + "#{parent.var_name}.append(#{var_name}, #{the_label})\n" # If a submenu elsif parent.kind_of?(Menu) (the_label) else Kernel.raise("Menu shouldn't be attached to a #{parent.class}") end end |