Skip to content

[orx-gui] Invoke onChange in Parameter Path - #383

Open
hamoid wants to merge 1 commit into
masterfrom
invokeOnChangeInParameterPath
Open

[orx-gui] Invoke onChange in Parameter Path#383
hamoid wants to merge 1 commit into
masterfrom
invokeOnChangeInParameterPath

Conversation

@hamoid

@hamoid hamoid commented Feb 9, 2026

Copy link
Copy Markdown
Member

It's the only parameter type that does not trigger change events.

Without this change changes to @PathParameter variables can't be detected in gui.onChange.

It's the only parameter type that does not trigger change events.
@hamoid
hamoid requested a review from edwinRNDR February 9, 2026 15:21
@hamoid
hamoid marked this pull request as draft February 9, 2026 17:16
@hamoid

hamoid commented Feb 9, 2026

Copy link
Copy Markdown
Member Author

I see now that my code is incomplete. Change events are not triggered when assigning a new value to the annotated variable.

@hamoid
hamoid marked this pull request as ready for review February 10, 2026 11:32
@hamoid

hamoid commented Feb 10, 2026

Copy link
Copy Markdown
Member Author

I found this demo https://github.com/openrndr/orx/tree/master/orx-jvm/orx-gui#demopath01 which shows how to persist a PathParameter.

This is enough for what I need, but there's an difference between how IntParameter and PathParameter or TextParameter behaves:

With IntParameter I can do settings.num = 5 and it triggers the gui.onChange { } listener. This does not happen if I do settings.t = "hi" or settings.imagePath = "demo-data/images/image-001.png". There's no events.valueChanged triggered in those cases.

Update:

I investigated further and find different behaviors in https://github.com/openrndr/orx/tree/master/orx-jvm/orx-panel/src/main/kotlin/org/openrndr/panel/elements

I think the only element that implements a setter that triggers valueChanged is
https://github.com/openrndr/orx/blob/master/orx-jvm/orx-panel/src/main/kotlin/org/openrndr/panel/elements/Slider.kt#L49

The other elements I looked into do not seem to implement such a setter.

@hamoid

hamoid commented Mar 16, 2026

Copy link
Copy Markdown
Member Author

After recent changes to orx, I see that annotations like @TextParameter, @ColorParameter and others DO trigger onChange events 👍

If this should happen with @ParameterPath this PR can be merged, or closed otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant