Class: Sketchup::Menu
- Inherits:
-
Object
- Object
- Sketchup::Menu
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb
Overview
An interface to a menu.
Instance Method Summary collapse
-
#add_item(*args) ⇒ Object
The #add_item method is used to add a menu item to the specified menu.
-
#add_separator ⇒ nil
The #add_separator method is used to add a menu separator to a menu.
-
#add_submenu(title) ⇒ Sketchup::Menu
The #add_submenu method is used to add a sub-menu to a menu.
-
#set_validation_proc(item) { ... } ⇒ Object
The #set_validation_proc method is used to specify the menu validation procedure.
Instance Method Details
#add_item(title) { ... } ⇒ Integer #add_item(command) ⇒ Integer
The #add_item method is used to add a menu item to the specified menu.
This method takes a block that defines the action to perform when the menu item is selected.
The item id that is returned can be used when adding an optional validation procedure for the menu item.
35 36 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb', line 35 def add_item(*args) end |
#add_separator ⇒ nil
The #add_separator method is used to add a menu separator to a menu.
47 48 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb', line 47 def add_separator end |
#add_submenu(title) ⇒ Sketchup::Menu
The #add_submenu method is used to add a sub-menu to a menu.
65 66 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb', line 65 def (title) end |
#set_validation_proc(item) { ... } ⇒ Object
The #set_validation_proc method is used to specify the menu validation procedure. Your procedure should return either MF_ENABLED, MF_DISABLED, MF_CHECKED, MF_UNCHECKED, or MF_GRAYED.
90 91 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb', line 90 def set_validation_proc(item, &block) end |