macMikey / LCB-missing-manual

I'm trying to learn LCB, again, but the docs are thin.
MIT License
4 stars 4 forks source link

[property metadata] default with executable and option #3

Open macMikey opened 2 years ago

macMikey commented 2 years ago

The default property in the Property data file readme says Default values may use the execute: syntax. If they do, the script is executed, and the default value for the property is whatever is in the it variable afterward. By script, do we mean an LCS handler, or do we mean a function in the LCB file?

NOTE: option also includes the same description of using execute

bwmilby commented 2 years ago

It is going to be LCS. The PI is purely in the realm of the IDE and on the LCS side. I'm not sure how to use this syntax though.

macMikey commented 2 years ago

It's curious that you cannot us execute script during OnCreate() and OnLoad(), but default values for properties can use the execute: syntax.

bwmilby commented 2 years ago

I can see an example in code for using it for options which makes sense because it is not evaluated until you open the PI focused on the widget. I think we would need to test for default to see if it would work.

I found this in the repo: https://github.com/livecode/livecode-ide/blob/develop/notes/feature-property_inspector.md

macMikey commented 2 years ago

https://livecode.com/topic/hacking-the-ide-properties-elanor-buchanan-2pm/