UILayout layout.box()

Hi,

if you have something like this:

box = layout.box()
box.prop(something_0)
box.prop(something_1)
box.prop(something_2)

is it possible for me to disable or deactivate one of those props in this box? I just wonder if it’s possible now when they all are in one box and if so, how it’s possible.

Thanks!

it’s possible, but you need a sub-layout element:

box = layout.box()

row = box.row()
row.active = some_condition() # True or False
row.prop(something_0)

row = box.row()
row.enabled = not something_0
row.prop(something_1)

row = box.row()
row.alert = something_2 > 10
row.prop(something_2)

Oh, why didn’t I think of that! Thanks dude. :slight_smile:
Btw, what does the alert method do? If I did it on a check-box it got marked red, but I guess it does something more than just change the color or?

nope, just that.

Okay, thanks!