Immutable inputs
Would be a great enhancement to 'disable' an input, e.g. to preview data.
Seems like a useful addition. I can have a look at how Dear ImGui does it.
Temporary solution is to create a seperate state, and updating the input's state to it whenever numberChanged() is true.
I attempted something like this previously, with a disabled property which would prevent updates from happening. However, due to the way that Iris updates, with Instance events happening out of order, it's a bit difficult to prevent a widget from updating properly.
Would you like this to prevent the user from interacting with a widget, but allow updates to happen, or a full 'freeze' of widgets that prevents any state changes?
@SirMallard The use case I wanted this for was displaying data, so 'freezing' widgets would work for this.
I don't think I was clear here.
By freezing, I mean it will not update when the state object behind it changes, ie. if there's a state object which controls it and you update the state object, it won't change the widget visually.
And by interaction, I mean that they can't drag or press the widget to update it, but the state objects can still make changes, allowing you to just 'display' values, without the user's mouse or keyboard changing the values.
@SirMallard Oops
And by interaction, I mean that they can't drag or press the widget to update it, but the state objects can still make changes, allowing you to just 'display' values, without the user's mouse or keyboard changing the values.
This is what I meant.
This is really tricky to do, beacuse widget interaction happens in multiple places across the frame. This means it is quite difficult to know whether a widget is immutable and then also how to prevent any changes from happening. In certain situations, the UI of a widget is updated before the state value is set, making it difficult to find where all the changes happen. I want to get this working, it is just quite difficult to find a nice solution without needing tonnes of checks.