re-commit temp workaround [#35920], this still fails for OSX retina display,
[blender-staging.git] / release / scripts / templates_py / ui_menu_simple.py
1 import bpy
2
3
4 class SimpleCustomMenu(bpy.types.Menu):
5     bl_label = "Simple Custom Menu"
6     bl_idname = "OBJECT_MT_simple_custom_menu"
7
8     def draw(self, context):
9         layout = self.layout
10
11         layout.operator("wm.open_mainfile")
12         layout.operator("wm.save_as_mainfile")
13
14
15 def register():
16     bpy.utils.register_class(SimpleCustomMenu)
17
18
19 def unregister():
20     bpy.utils.unregister_class(SimpleCustomMenu)
21
22 if __name__ == "__main__":
23     register()
24
25     # The menu can also be called from scripts
26     bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname)