Class: Iup::SubMenu
Overview
A menu item that, when selected, opens another menu.
Attributes
- image
-
Image to show on menu.
- title
-
Label of menu.
- wid
-
read-only Native widget identifier.
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#image(val = nil) ⇒ Object
– attributes.
-
#initialize(title, item, &block) ⇒ SubMenu
constructor
Creates instance of a SubMenu.
Methods inherited from Widget
#assign_handle, #enterwindow_cb, #getfocus_cb, #help_cb, #k_any, #killfocus_cb, #leavewindow_cb, #map_cb, #open_controls, #unmap_cb
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_readonly, #define_id_writeonly, #define_property_attribute, #define_property_writeonly, #define_readonly, #define_writeonly
Methods included from CallbackSetter
Constructor Details
#initialize(title, item, &block) ⇒ SubMenu
Creates instance of a SubMenu.
- title
-
Label of menu
- item
-
child menu to open
- block
-
optional block to set menu’s attributes
18 19 20 21 22 23 |
# File 'lib/wrapped/submenu.rb', line 18 def initialize title, item, &block @handle = IupLib.IupSubmenu title, item.handle # run any provided block on instance, to set up further attributes self.instance_eval &block if block_given? end |
Instance Method Details
#image(val = nil) ⇒ Object
– attributes
27 28 29 |
# File 'lib/wrapped/submenu.rb', line 27 def image val=nil # :nodoc: attribute_reference 'IMAGE', ImageWidget, val end |