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:
authorCampbell Barton <ideasman42@gmail.com>2011-02-18 11:47:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-18 11:47:37 +0300
commit063a7f217be43718a69f6cbcfcf322ca71bdeeb0 (patch)
treeb51313f72b471bc8193b1924d6f3c3f764094b85 /doc/python_api/examples/bpy.types.Menu.2.py
parentc4d7bb80f508b123d13581b4189ab7293105d98c (diff)
python api docs & examples for registrable Menu/Panel/Operator/PropertyGroup classes.
Diffstat (limited to 'doc/python_api/examples/bpy.types.Menu.2.py')
-rw-r--r--doc/python_api/examples/bpy.types.Menu.2.py16
1 files changed, 16 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..4579dd6c485
--- /dev/null
+++ b/doc/python_api/examples/bpy.types.Menu.2.py
@@ -0,0 +1,16 @@
+"""
+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)