Main Menu

Enabled

Started by rbenn674, 18 December 2022, 18:07:45

rbenn674


I was under the impression that enable = 0 should make the widget visible, but not actionable.

QuoteVisible and enabled
The enabled property determines if a widget receives events. If a widget is disabled, it will still be drawn but it will be unresponsive to your mouse clicks.


However, if I set a widget enable to false, this also makes my widget no longer visible. Is this intended?

I am trying to set a knob to exact positions based on a separate event, whereas the knob itself isn't adjustable (ie:disabled).

texus

#1
The 'Enabled' property has no influence on whether or not a widget is shown, the description is badly formulated. Disabling a widget simply means that you can no longer interact with it.

That line in the tutorial is only correct under the assumption that Visible = 1, otherwise it will never be drawn. The Enabled property has no effect when the widget is invisible though (as an invisible widget already can't be interacted with).

QuoteHowever, if I set a widget enable to false, this also makes my widget no longer visible. Is this intended?
That might be a bug. I quickly tried creating a Knob and setting its Enabled property and it seems to work fine here: the knob remains visible but its value can no longer be changed by clicking on it with the mouse (but it can still be changed by calling the setValue function).

Do you do anything special with the knob?
If it isn't drawn for no clear reason then maybe somehow the color used for the disabled widget are set to transparent, but that shouldn't happen by default.

rbenn674

Thanks for the reply.

I verified no issue as you mentioned with a new knob. I realized the OpacityDisabled was set to "0" instead "-1" default. Not entirely sure what that does but that was the cause of my issue. Thanks again for leading me in the right direction.