relaunching a stack that is open

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

relaunching a stack that is open

Post by marksmithhfx » Wed Jun 15, 2022 10:55 am

Lets say you are modifying some code in a preOpenStack handler and just want to quickly test it, or perhaps just setup the environment with a new setting. Is there a keyboard shortcut to just relaunch/reopen the stack? Generally I resort to closing / saving the app, then reopening using the Open Recent File option, but I was wondering if there is something simpler.

Thanks
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: relaunching a stack that is open

Post by dunbarx » Wed Jun 15, 2022 2:31 pm

Hi.

Why not just:

Code: Select all

send "preOpenCard" to stack "yourStack"
Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: relaunching a stack that is open

Post by jacque » Wed Jun 15, 2022 5:26 pm

I usually use the message box as Craig said, but you can also use the contextual menu. On Mac, hold down cmd-shift-comtrol and click, and then choose Send Message from either the stack or card menus. On Windows, control+shift+right click.

Here's a handy reference:
https://livecode.byu.edu/helps/shortcuts.php
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: relaunching a stack that is open

Post by dunbarx » Wed Jun 15, 2022 5:29 pm

It occurs to me that I am not certain where your "preOPenCard" handler is, so you may have to, for example;

Code: Select all

send "preOpenCard" to card 1 of stack "yourStack"
Craig

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: relaunching a stack that is open

Post by stam » Wed Jun 15, 2022 5:34 pm

i frequently use the messabox for this

make sure you stack is in the foreground (so its name or one of it's controls are named in the message box (just to the right of the small buttons)) and just type

Code: Select all

preOpenCard
or whatever other handler you want to run. Always works as expected...

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: relaunching a stack that is open

Post by jmburnod » Wed Jun 15, 2022 7:13 pm

As said above you may test handlers from message box.
But relaunch/reopen can send several messages.
We may use a handler that simulate it and send this handler from the messagebox :D

Best
Jean-Marc
https://alternatic.ch

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: relaunching a stack that is open

Post by marksmithhfx » Sat Jun 18, 2022 8:14 pm

stam wrote:
Wed Jun 15, 2022 5:34 pm
i frequently use the messabox for this

make sure you stack is in the foreground (so its name or one of it's controls are named in the message box (just to the right of the small buttons)) and just type

Code: Select all

preOpenCard
or whatever other handler you want to run. Always works as expected...
Thanks, I'll have to give it a try.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Post Reply