wdas / SeExpr

SeExpr is an embeddable, arithmetic expression language that enables flexible artistic control and customization in creating computer graphics images. Example uses include procedural geometry synthesis, image synthesis, simulation control, crowd animation, and geometry deformation. https://wdas.github.io/SeExpr
https://www.disneyanimation.com/open-source/seexpr/
Other
406 stars 86 forks source link

ExprEditor needs a uniform signal for change events #90

Open nrusch opened 5 years ago

nrusch commented 5 years ago

I'm working on a project that involves integrating the ExprEditor class into another application's UI, and I need to know when the expression text has changed in any way in order to dispatch change notifications to the host.

Currently, there seems to be no consistent signal emitted to indicate that the expression text has changed in some way; the only way to get a reliable notification is to manually hit Ctrl + Return.

A fairly straightforward (but possibly naive) approach to addressing this would be to call sendApply() from inside of exprChanged, but I wanted to solicit some more educated opinions here before going that route. Also, I think it might make to consider giving the signal a more self-documenting naming like exprChanged.

Any thoughts?

Thanks.

davvid commented 5 years ago

In that sense the apply() signal would become the uniform signal, which doesn't sound too bad.

If you wanted the signal to be emitted after the controls have been already been rebuilt then calling sendApply() at the end of rebuildControls() would be appropriate.