add_item may take 2 forms.
Overloads:
menu = UI.menu("Plugins") menu_id = menu.add_item("Calculate Area"} { calc_area }
Parameters:
the name of the menu item, or a UI::Command object.
menu = UI.menu("Plugins") cmd = UI::Command.new("Calculate Area") { calc_area } menu_id = menu.add_item(cmd)
a UI::Command object
Returns:
a unique numeric id number
20 21
# File 'lib/menu.rb', line 20 def add_item(item) end