LC8DP4 LCB Guide? Possible to have a default Script

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Mon Sep 07, 2015 6:00 pm

LC8DP4 (on Mac OS X 10.6.8)
The extending LC / LCB guide in Dictionary/API window seems to have been replaced with HTML5 deploy info?
I can't find it, dictionary / API doesn't seem to be working quite as well as the DP2 release. I know LCB is in mid evolution but it would be nice if the documentation was kept up along the way so people can experiment.

I figured out how to update the metadata in my widget to get it to compile OK anyway. I replaced community.livecode.author.mywidget with com.livecode.widget.mywidget (so there is no longer a difference from community made widgets and official LC widgets?) in the widget declaration meta, I added default size meta, and a nice svg icon path meta.

Is there a way to have a widget contain a pre-filled-out LCS script, as a basic usage example, so that the widget is functional as soon as it's placed but can then be edited by the stack author/widget user? Either that or maybe have the ability to include a demo-stack on the extension-store?
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by livecodeali » Tue Sep 08, 2015 10:00 am

PaulDaMacMan wrote:LC8DP4 (on Mac OS X 10.6.8)
The extending LC / LCB guide in Dictionary/API window seems to have been replaced with HTML5 deploy info?
I can't find it, dictionary / API doesn't seem to be working quite as well as the DP2 release. I know LCB is in mid evolution but it would be nice if the documentation was kept up along the way so people can experiment.
There is an issue with the dictionary's initial size in DP 4, if you resize the stack it should reveal the dropdown with all the other guides.
PaulDaMacMan wrote: I figured out how to update the metadata in my widget to get it to compile OK anyway. I replaced community.livecode.author.mywidget with com.livecode.widget.mywidget (so there is no longer a difference from community made widgets and official LC widgets?)
We are using com.livecode.widget.<widgetName> for our widgets that come with the IDE, but you should still use community.livecode.PaulDaMacMan.mywidget (or whatever author name you are using).
PaulDaMacMan wrote: Is there a way to have a widget contain a pre-filled-out LCS script, as a basic usage example, so that the widget is functional as soon as it's placed but can then be edited by the stack author/widget user? Either that or maybe have the ability to include a demo-stack on the extension-store?
That's a good idea actually, the ability to include a demo stack on the store would be pretty useful.

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Tue Sep 08, 2015 1:06 pm

>> community.livecode.PaulDaMacMan.mywidget
I don't think it would compile when I used something similar to that, but maybe I used community.livecode.widget.PaulDaMacMan.mywidget or community.livecode.widget.mywidget thinking the type (widget) needed to be included. I'll have to go back and check (and read the docs now that I can find them, thanks). I definitely had a metadata issue because it compiled ok soon after that.

Will SVG-path icons now or in the future be required or are bitmap/png icons still OK to use? It was a quick-fix for me to add the meta icon path this time because my widget is made of SVG paths so I just used one of them.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Tue Sep 08, 2015 1:10 pm

Just read about the png icons needing to go into a "/support" folder. Probably best to go with SVG paths for different display resolutions anyway.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Wed Feb 24, 2016 7:13 pm

Ali,
I was very happy to see that defaultscript feature added to the latest build 8.0dp15, unfortunately I can't seem to make it work in my widget. I'm pretty sure I named the stack & the stack file correctly because the script shows up in the extension builder window when I load my project, but after compile and place the widget on a card it does not contain that script. Any ideas what might be wrong? Thanks!
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by livecodeali » Thu Feb 25, 2016 4:35 pm

Hi Paul,
Thanks, I can see why that's not working properly - I will get this fixed for DP 16.

Sorry about that!
Ali

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Thu Feb 25, 2016 10:46 pm

livecodeali wrote:Hi Paul,
Thanks, I can see why that's not working properly - I will get this fixed for DP 16.

Sorry about that!
Ali
No apologies necessary, that's what developer previews are for right!
I'm so jazzed that it's there, it will be very useful!
Looking forward to DP16!

Thanks!
Paul
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Tue Mar 29, 2016 1:20 am

I dont want to be a nag, but I don't think the fix for default scripts in widgets made it into DP16.
I'm getting the same result. The script appears in the extension builder window but after I build and drag an instance of the widget to a card the widgets script is still empty.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by peter-b » Tue Mar 29, 2016 10:18 am

PaulDaMacMan wrote:I dont want to be a nag, but I don't think the fix for default scripts in widgets made it into DP16.
I'm getting the same result. The script appears in the extension builder window but after I build and drag an instance of the widget to a card the widgets script is still empty.
It seems to be working for the "default" widgets that we ship with LC8 when I test it -- do the default scripts work for those? Is the problem limited to custom widgets that you're working on using the Extension Builder?
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Wed Mar 30, 2016 2:19 am

Yes, Most of the widgets that ship with LC8 now have default scripts when I create instances of them, but I can't seem to get them to work in my own custom widgets (though, as I said, they do show in the extension builder window). There seems to be some GUI related issues going on with widgets as well (disappearing tools palette, having to select edit script twice to get to script editor). Hope to get a chance to spend some quality time with the dev builds as I haven't really gotten to check out DP16 much yet.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by peter-b » Wed Mar 30, 2016 9:14 am

Sorry to hear that you're still having problems. :( Can you package up a widget that's exhibiting the problem and attach the widget's .lce file to a bug report, please?

Have you tried copying one of the built-in widget's directories to your desktop, ripping out our code and putting yours in its place? That might be a good way to check whether there's some non-obvious difference in file layout (or something) that's causing the issue.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Wed Mar 30, 2016 7:26 pm

Have you tried copying one of the built-in widget's directories to your desktop, ripping out our code and putting yours in its place? That might be a good way to check whether there's some non-obvious difference in file layout (or something) that's causing the issue
OK I copied the SVG Path folder and replaced scripts/resources with my those of my project and it did indeed work correctly! So there must be something off about my original project folder or defaultscript.livecodescript file. I originally created defaultscript.livecodescript as a script-only stack from LC8DP15, this new one was created with a plain old text editor. Not sure it's worth filing a bug report over yet. I'll try it with another widget project I had the same problem with later today.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by PaulDaMacMan » Wed Mar 30, 2016 8:14 pm

I noticed my default scripts are in new instances of my widget but they're non-functional until I open the script-editor and hit apply. I'm wondering if this is intentional behavior or a bug in the implimentation?
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by peter-b » Wed Mar 30, 2016 9:30 pm

PaulDaMacMan wrote:I noticed my default scripts are in new instances of my widget but they're non-functional until I open the script-editor and hit apply. I'm wondering if this is intentional behavior or a bug in the implimentation?
It's intentional -- it's just like the button control, for example; its script is empty until you open the script editor; then a "mouseUp" handler is automatically prepopulated for you, but it's not actually there yet until you "Apply".
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: LC8DP4 LCB Guide? Possible to have a default Script

Post by livecodeali » Mon Apr 04, 2016 4:42 pm

PaulDaMacMan wrote:having to select edit script twice to get to script editor
In my experience this is a classic sign of preference stack 'corruption'. You might want to try deleting it, it should improve things somewhat.

Post Reply

Return to “LiveCode Builder”