LC8DP4 LCB Guide? Possible to have a default Script
-
- Posts: 617
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: LC8DP4 LCB Guide? Possible to have a default Script
It was indeed a corrupt preference file, something to watch out for, thanks.
-
- Posts: 617
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: LC8DP4 LCB Guide? Possible to have a default Script
This feature now seems to be broken now in LC 9 DP 8. The default script appears in the extension builder window but it is not attached to the compiled widget as the default script when you go to edit the widgets script. I saw some talk on the list of possibly making a preference to turn off default scripts, but that doesn't appear to be the case yet. I'm wondering if the feature removal was on purposeful or should it be a bug report?
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: LC8DP4 LCB Guide? Possible to have a default Script
It hasn't been removed, it's just been tweaked slightly! Instead of filling the script editor with the content of the default script automatically, and handlers in the default script will be used when a default handler is added from the handler list on the left. This means you can have any number of default handlers in there and they are only added to the script when requested.
All documented messages for a given widget are listed in the default handlers list, and when clicked it either adds the corresponding handler from the default script (if there is one) or constructs a default handler using the documented message name and parameters.
All documented messages for a given widget are listed in the default handlers list, and when clicked it either adds the corresponding handler from the default script (if there is one) or constructs a default handler using the documented message name and parameters.
-
- Posts: 617
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: LC8DP4 LCB Guide? Possible to have a default Script
Ah, I see. I hadn't documented the default script within the LCB because, like the Header Bar widget, it uses mouseUp which is a standard message. It seems odd to have to document mouseUp when it's been part of the standard dictionary for decades.livecodeali wrote:It hasn't been removed, it's just been tweaked slightly! Instead of filling the script editor with the content of the default script automatically, and handlers in the default script will be used when a default handler is added from the handler list on the left. This means you can have any number of default handlers in there and they are only added to the script when requested.
All documented messages for a given widget are listed in the default handlers list, and when clicked it either adds the corresponding handler from the default script (if there is one) or constructs a default handler using the documented message name and parameters.
Then there's another problem I have with this change. One of my defaultScript.livecodescript relied on a local variable declaration (which I was able to work around using a property) as well as a interaction between two handlers; mouseUp and mouseLeave (though it looks like the mouseLeave part never worked anyway because my widget wasn't firing a mouseLeave message).
-
- Posts: 617
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: LC8DP4 LCB Guide? Possible to have a default Script
So this will allow the any default scripts to be inline within the LCB with no need for the external .livecodescript file?
Also will this allow multiple alternative scripts (for example different "mouseUp" behaviors to pick from) as well?
In any case this is a pretty sweet enhancement, a real time saver.
Also will this allow multiple alternative scripts (for example different "mouseUp" behaviors to pick from) as well?
In any case this is a pretty sweet enhancement, a real time saver.