diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-01 08:06:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-01 08:06:38 +0400 |
commit | 2d4a682a8e48e41af2867bc71a621eb0fac27b1e (patch) | |
tree | 040f6811f870d72f8268250b61f719b3eef2f0a7 /doc | |
parent | 0ad88d1001449f71b9448e237e6f05fb244f1a85 (diff) |
add popup menu to allow python scripts to show popups without having to define a menu class first.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/examples/bpy.types.WindowManager.popup_menu.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py b/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py new file mode 100644 index 00000000000..c1887d8b41d --- /dev/null +++ b/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py @@ -0,0 +1,14 @@ +""" +Popup Menus ++++++++++++ +Popup menus can be useful for creating menus without having to register menu classes. + +Note that they will not block the scripts execution, so the caller can't wait for user input. +""" + +import bpy + +def draw(self, context): + self.layout.label("Hello World") + +bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO') |