Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/python_api/examples/bpy.types.Menu.2.py')
-rw-r--r--doc/python_api/examples/bpy.types.Menu.2.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.Menu.2.py b/doc/python_api/examples/bpy.types.Menu.2.py
new file mode 100644
index 00000000000..c87b10cb6e7
--- /dev/null
+++ b/doc/python_api/examples/bpy.types.Menu.2.py
@@ -0,0 +1,17 @@
+"""
+Extending Menus
++++++++++++++++
+When creating menus for addons you can't reference menus in blenders default
+scripts.
+
+Instead the addon can add menu items to existing menus.
+
+The function menu_draw acts like Menu.draw
+"""
+import bpy
+
+
+def menu_draw(self, context):
+ self.layout.operator("wm.save_homefile")
+
+bpy.types.INFO_MT_file.append(menu_draw)