Class: Sketchup::Menu

Inherits:
Object show all
Defined in:
lib/menu.rb

Instance Method Summary collapse

Instance Method Details

#add_item(menu_item) ⇒ menu_id #add_item(command) ⇒ menu_id

add_item may take 2 forms.

Overloads:

  • #add_item(menu_item) ⇒ menu_id

    Examples:

    menu = UI.menu("Plugins")
    menu_id = menu.add_item("Calculate Area"} { calc_area }

    Parameters:

    • menu_item (String)

      the name of the menu item, or a UI::Command object.

  • #add_item(command) ⇒ menu_id

    Examples:

    menu = UI.menu("Plugins")
    cmd = UI::Command.new("Calculate Area") { calc_area }
    menu_id = menu.add_item(cmd)

    Parameters:

Returns:

  • (menu_id)

    a unique numeric id number


20
21
# File 'lib/menu.rb', line 20

def add_item(item)
end

#add_separatorObject


23
24
# File 'lib/menu.rb', line 23

def add_separator
end

#add_submenu(menu_name) ⇒ Object


25
26
# File 'lib/menu.rb', line 25

def add_submenu(menu_name)
end

#set_validation_proc(item, &block) ⇒ Object


27
28
# File 'lib/menu.rb', line 27

def set_validation_proc(item, &block)
end