5
$\begingroup$

In an add-on I would like to have a property adjustable via its UI element, but when I have a second elements enabled I want my first element to be disabled : only show the information without being editable. It there a way to make a UI element read-only ? (grayed out / disabled / visible but un-editable).

$\endgroup$
5
$\begingroup$

Try:

col = layout.column()
col.enabled = False
# Use col.prop, col.operator, etc. Everything you add to this column will be faded

col.active is also possible, it will grey out the column but the props will still be editable (this is probably not something you want)

$\endgroup$
  • $\begingroup$ Actually the attribute i think I was looking for is enabled so the solution is more like col.enabled = False. Also if want only one property to be enabled/disabled I need to put just that property inside of a col/box/row UI element and then hide the col/box/row. $\endgroup$ – DolphinDream Nov 15 '15 at 1:11
  • $\begingroup$ What about a specific item in a row? so maybe there is a randomize checkbox beside a color well. The box disabled the well. Seems only if it's on a separate row or hide it? but I want to see the randomized color in the well. $\endgroup$ – Master James Nov 13 '18 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.