From 063a7f217be43718a69f6cbcfcf322ca71bdeeb0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 18 Feb 2011 08:47:37 +0000 Subject: python api docs & examples for registrable Menu/Panel/Operator/PropertyGroup classes. --- doc/python_api/examples/bpy.types.Menu.2.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/python_api/examples/bpy.types.Menu.2.py (limited to 'doc/python_api/examples/bpy.types.Menu.2.py') 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) -- cgit v1.2.3