class Iup::Menu

A menu is a collection of menu items, submenus, and separators. It is usually placed within a Dialog, or launched from an action, using popup.

This widget basically acts as a container for other menu widgets, but setting the radio attribute makes those other widgets act as a radio group.

Example

The following example creates open, save and exit menu items, and places them onto a menu. The save menu item is initially inactive. Notice the use of a separator, and how a SubMenu adds a clickable title to the file menu.

item_open = Iup::MenuItem.new('Open')
item_save = Iup::MenuItem.new('Save') do |i|
  i.active = 'NO'
end
item_exit = Iup::MenuItem.new('Exit', ->{ Iup::CLOSE })
file_menu = Iup::Menu.new(
  item_open, item_save, 
  Iup::Separator.new, 
  item_exit)
menu = Iup::Menu.new(Iup::SubMenu.new('File', file_menu))

See also: MenuItem, Separator, SubMenu