CMake: add WITH_LINKER_LLD option for unix platforms
[blender-staging.git] / doc / python_api / examples / bpy.types.Panel.1.py
1 """
2 Simple Object Panel
3 +++++++++++++++++++
4
5 This panel has a :class:`Panel.poll` and :class:`Panel.draw_header` function,
6 even though the contents is basic this closely resembles blenders panels.
7 """
8 import bpy
9
10
11 class ObjectSelectPanel(bpy.types.Panel):
12     bl_idname = "OBJECT_PT_select"
13     bl_label = "Select"
14     bl_space_type = 'PROPERTIES'
15     bl_region_type = 'WINDOW'
16     bl_context = "object"
17     bl_options = {'DEFAULT_CLOSED'}
18
19     @classmethod
20     def poll(cls, context):
21         return (context.object is not None)
22
23     def draw_header(self, context):
24         layout = self.layout
25         layout.label(text="My Select Panel")
26
27     def draw(self, context):
28         layout = self.layout
29
30         box = layout.box()
31         box.label(text="Selection Tools")
32         box.operator("object.select_all").action = 'TOGGLE'
33         row = box.row()
34         row.operator("object.select_all").action = 'INVERT'
35         row.operator("object.select_random")
36
37
38 bpy.utils.register_class(ObjectSelectPanel)