eez-open / studio

Cross-platform low-code GUI and automation
https://www.envox.eu/studio/studio-introduction/
GNU General Public License v3.0
609 stars 101 forks source link

Read-only variables for reduced code generation #599

Open PhonicUK opened 1 month ago

PhonicUK commented 1 month ago

When a variable is only used on a control which is not editable and will never be changed by the UI (such as a label) - there's no need for the generated code to produce a stub for a setter.

It would be nice if we could explicitly set variables as read only so that the code generation won't produce set_var_my_variable(value) stubs that get implemented as nothing and serve no purpose.

Right now I'm either implementing these as empty methods where I don't want/need them, or manually removing the stubs - but this is extra work. Removing these would help make the overall code slightly cleaner by reducing unnecessary cruft.