Creating LiveCode applications that play well with git

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 10:26 pm

Hi,

Belay my last - stackfiles prop : Users/trevordevore/Development/levure/framework/levure.livecodescript

should be ../framework/levure.livecodescript

Ah, you beat me to it - I was busy running multiple fsck -fy

Thanks

Simon
best wishes
Skids

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: Creating LiveCode applications that play well with git

Post by openworld » Sat Mar 18, 2017 12:09 am

Trevor,

I loved the clarity of the explanation of your videos on the Levure framework and SublimeText. The prospect of collaboration with version control on Github is exciting. I've downloaded SublimeText and look forward to going up the learning curve.

For the legions of us who are new to Levure, could a Livecode app be created for easier migration into its framework?

Placeholder cards might be set up in a template stack, for example, in a pattern that mirrors the top-level of the Levure framework as shown in the attached screenshot.

Creators of Livecode apps then could copy-paste scripts from our existing stacks – as well as new ones we are just starting to develop – into the defined target locations of this template stack.

It would be wonderful if tips on how to avoid the bracket syntax problems and other issues Simon encountered could be included in any of the key placeholder cards. This would help ensure that scripts stored in the Levure template stack could then later be transferrd via SublimeText into Levure more smoothly.

I would gladly volunteer to be an early tester, if something like this would help with Livecode project migration to Github.

Look forward to hearing, and helping in any way I can!

Best,

Mark
Openworld
Attachments
ScriptOnlyStacksAndLevure.png

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sat Mar 18, 2017 4:07 pm

Here I've been bugging Trevor for weeks, and we had a place right here. Can we maybe rename this thread to Levure, and perhaps have a section in the forums for Git-enabled LC? So far we have two frameworks that I know of: Levure, BAF. I don't know if BAF is going to ever gain any traction but I think Levure will.

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sat Mar 18, 2017 4:19 pm

In case anyone else was tired of manually indenting their script files in ST, I have ported (and overhauled/fixed) Peter's Atom indent rules to ST. Trevor has accepted them into the livecode-sublimetext repo, so, now, you can have your scripts indent/autoindent in ST.

You can also have ST use command-tab to auto/reindent by going to Sublime Text->Preferences->Key Bindings and adding the following to your keymap:
[
{"keys": ["super+enter"], "command": "reindent", "args": {"single_line": false}}
]
Last edited by Mikey on Sun Mar 19, 2017 3:02 am, edited 1 time in total.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Sat Mar 18, 2017 4:44 pm

openworld wrote:Trevor,

I loved the clarity of the explanation of your videos on the Levure framework and SublimeText. The prospect of collaboration with version control on Github is exciting. I've downloaded SublimeText and look forward to going up the learning curve.

For the legions of us who are new to Levure, could a Livecode app be created for easier migration into its framework?
Hi Mark. I'm encouraged to see the number of people that are interested in the framework.

Brian Spencer has been hard at work on translating my chicken scratch notes in the original README into proper documentation. This has been a tremendous help and is going to help many more people get started! All of the docs are part of the wiki on the github page:

https://github.com/trevordevore/levure/wiki

We still have work to do but the docs are coming along nicely. @Mikey has also provided some great feedback that I will incorporate once I get back from a spring break trip with my kids.

As part of the documentation I created a stack that will create a new Levure project. It is documented it here:

https://github.com/trevordevore/levure/ ... ect-Folder

Learning materials will continue to evolve as more and more people pitch in. Learning materials take a lot of time and if they are to be made it will take a community effort. I won't have time to put together the types of getting started materials that some people would like but I try to answer specific questions to help people get unstuck. I would be very grateful to anyone that is willing to take the time to work through setting up projects and contributing to the learning materials for others to use.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sat Mar 18, 2017 4:54 pm

Those two guys have done a TON of work to make this project easier to understand. The wiki is very helpful, and Trevor has been making it much easier to help us integrate Levure while keeping it out of the way.

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: Creating LiveCode applications that play well with git

Post by openworld » Sun Mar 19, 2017 12:43 am

Error-CreateLevureApplication.jpg
Trevor and Mikey,

Thanks for the advice and pointers. I tried following the wiki instructions, by creating a new folder that I named "LevureFolderforLivecode" on my local drive. I moved my Livecode project stack there, along with a back up copy. I then launched Livecode used the Message tool to pull the Levure stack in.

Things started well, but then I got an error message (screenshot attached). Can you spot what may have gone awry?

I do have a Github account, but there is no Livecode project stored there. (When asked during the attempted Levure stack import, I did click "Use Git"). As you can see on the screenshot, an "Open Application" dialog box for the semi?-imported stack did occur. But given the error message I have not yet tried to open the application, given the worrry of corrupting the file.

Appreciate any help! Will send in next response a snapshot of the file contents of what portion of the Levure app did make it into the newly-created local target folder.

Best,

Mark

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: Creating LiveCode applications that play well with git

Post by openworld » Sun Mar 19, 2017 12:47 am

LevurePartsThatCameThrough.jpg
Trevor and Mikey (cont),

Here is what did arrive in the target localdrive folder from the Levure App stack, after I sent the message request for a download... hope it helps in spotting the problem!

Best,

Mark
@openworld

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Sun Mar 19, 2017 1:45 am

openworld wrote: Here is what did arrive in the target localdrive folder from the Levure App stack, after I sent the message request for a download... hope it helps in spotting the problem!
Two things -

1.The `levure` folder is missing from your screenshot. Since you checked the "Use Git" checkbox then the Levure installation stack tried to set up the `levure` folder using `git` commands. Let's check if "git" is accessible from the shell. What do you get in the Message Box if you execute the following command?

Code: Select all

put shell("git --version")
I see the following in LC 8.1.3 running on OS X 10.11:

Code: Select all

git version 2.10.1 (Apple Git-78)
2. Don't move your existing stack files into the Levure project folder before you create it. Create the Levure app in an empty folder. You will then go through and break apart your existing stack into different parts. If your stack has any startup logic then you would move that code to the `app.livecodescript` stack file. The UI parts of your stack would go into the `ui` folder as described at https://github.com/trevordevore/levure/wiki/ui. If you have questions about how to break up your stack to fit into the framework folders just ask.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sun Mar 19, 2017 1:51 am

whoa
whoa
whoa
whoa
whoa
whoa
WHOA

Don't be giving me credit for any of this. This has been all Trevor and Brian. All I've done is weeped and cried "I don't understand", then stole a file from Peter and worked on it until it looked right, and submitted it. Some day I might even, maybe, understand Git. Anyway, sorry, I don't know how to help ya.

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sun Mar 19, 2017 1:52 am

(retracting the question after I reread a post)
Last edited by Mikey on Sun Mar 19, 2017 3:04 am, edited 1 time in total.

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sun Mar 19, 2017 1:56 am

Next question, T,
My ST project appears to be set up correctly, but when I save a changed SOS, LC doesn't seem to notice, so where would I start looking or testing?
I went to app->ui->sample window->behaviors, and changed card_behavior.livecodescript as follows

Code: Select all

on mouseDown
   answer "DOWN!"
end mouseDown
Clicking on the button doesn't do anything, and drilling through the button to edit the script of the behavior does not show the change.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Sun Mar 19, 2017 2:09 am

Mikey wrote:Why would you put the startup logic inside the app.livecode stack, instead of having a behavior SOS to do it?
`app.livecodescript` is a script only stack. Messages are sent to this stack when the app starts up and is shutting down. For example, the `OpenApplication` message is sent when you should show your app UI. If you use the stack that creates a new levure project you see an example of opening a ui stack in the `app.livecodescript` stack.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Sun Mar 19, 2017 2:10 am

Mikey wrote:Next question, T,
My ST project appears to be set up correctly, but when I save a changed SOS, LC doesn't seem to notice, so where would I start looking or testing?
I actually just finished adding some notes to the wiki about this. Take a look at this page:

https://github.com/trevordevore/levure/ ... ck-updates

Do those instructions help?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Creating LiveCode applications that play well with git

Post by Mikey » Sun Mar 19, 2017 2:48 am

Yes, that works a lot better. You probably told me to do that, already. I'll put comments into an issue report. Thanks.

Post Reply

Return to “Talking LiveCode”