3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
insert_in_menu.py

Insert the command into the menu.

Insert the command into the menu

1# The simplest program - just show the Hello world!
2import coat
3# add the translation of the identifier "test_script"
4coat.ui.addTranslation("test_script", "The example command")
5# if the command is not inserted in the file menu, we insert it there
6if not coat.ui.checkIfMenuItemInserted("test_script"):
7 coat.ui.insertInMenu("File","test_script","")
8 coat.dialog().text("The 'test_script' inserted into the File menu.").ok().show()
9else:
10 # ... if inserted, we execute the action
11 coat.dialog().text("Hello world!").ok().show()
Definition coat.py:3450
insertInMenu(str Menu, str ID_in_menu, str script_path)
Insert the scripted command into the main menu.
Definition coat.py:3328
addTranslation(str id, str text)
Add the translation for the text identifier.
Definition coat.py:3367
bool checkIfMenuItemInserted(str ID_in_menu)
Check if the command inserted somewhere into the menu.
Definition coat.py:3349