Answer
When a Custom item uses prop_enum, pass the button label through the keyword argument text=. For example:
L.prop_enum(C.scene.tool_settings, "transform_pivot_point", "MEDIAN_POINT", text="Median")L is PME’s layout object and C is Blender’s active context. The explicit label is especially useful in compact headers and Popup Dialog rows. The data path above follows Blender 4.5–5.2; the 2018 discussion used the obsolete C.space_data.pivot_point path.
Steps
- Confirm the target enum on its Blender RNA owner. For the transform pivot, that owner is
C.scene.tool_settings. - Add a Custom item and call
L.prop_enum(data, property, value, text="..."). - Use the enum identifier (
MEDIAN_POINTin the example), not its display label. - Add one item per choice, or use a regular
L.prop(..., expand=True)when the whole enum should be expanded automatically. - Test the item in the host area and Blender modes where it will be used.
Pitfalls
- Omitting
text=can leave the button unlabeled or produce a Blender API argument error in older copied snippets. - Check an old context path against the supported Blender version. The transform pivot is
C.scene.tool_settings.transform_pivot_point. - Keep enum identifiers exact;
prop_enumdoes not accept the translated display name as the value argument. - A header is horizontal by design. If several controls need vertical space, use a Popup Dialog or side panel.
The original report concerned Blender 2.80. If an enum has changed since then, use the identifier from the Blender API for the version you use.