Prop Parameter "expand=False" did not change state?

Or I misunderstood what it’s mean?
Docs says that

expand (boolean , ( optional )) – Expand button to show more detail

I used this example
with adding expand=False parameter and did not notice any changes. I expected to see collapsed button.

the expand property of the example and expand argument of the function in the doc is a pure coincidence, they are both named “expand” but meant different usage

the expand argument is meant for properties such as EnumProperty to be expanded in their column or row state

try it out with a Enum prop you will understand the meaning of this argument :slight_smile:

1 Like

So it not possible to make it by default appear collapsed (closed)?

I only can add bpy.context.object.expanded = False before or after defined function to force state…but it works only after execute function.

not related for collapsing state but
parameter icon_only=True and text="Some description here"
do not get along together, text appear on the button independently of icon_only state.
So if I want other than “expanded” text to be appear by hover mouse on the button I need do some trick?

You just have to set the property with default=False

1 Like

Oh, understood! Thanks
In registry

bpy.types.Object.expanded = bpy.props.BoolProperty(default=True)

I was looking on this state in prop…