Is there a way to do this?

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
shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Is there a way to do this?

Post by shawnblc » Wed Oct 16, 2013 8:46 pm

I have two stacks.

On stack1 I have a button. Press the button on stack1 and stack1 is hidden and stack2 opens up. When stack2 is closed I'd like stack1 to become unhidden (show), but close (just close would be fine too). I'm sure there's a way to do this, just trying to wrap my head around the logic on how to script it.

Any suggestions?

Something like this: (doesn't work though)

Code: Select all

on closeStack
   show stack1 in 10 milliseconds
   close stack1
end closeStack
Last edited by shawnblc on Wed Oct 16, 2013 9:26 pm, edited 2 times in total.

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

Re: Is there a way to do this?

Post by dunbarx » Wed Oct 16, 2013 9:24 pm

Hi.

Not clear to me what the sequence is. Please reread your post. Do you mean that when stack 2 closes (Is there a button on stack 2?), it hides, and stack 1 reappears? Just asking.

But in any case, have you tried, in the button script on stack 1, to (pseudocode):

close this stack --or name the stack explicitly
open the other stack --or name the stack explicitly

and the same in stack 2.

Craig Newman

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Is there a way to do this?

Post by shawnblc » Wed Oct 16, 2013 9:30 pm

dunbarx wrote:Hi.

Not clear to me what the sequence is. Please reread your post. Do you mean that when stack 2 closes (Is there a button on stack 2?), it hides, and stack 1 reappears? Just asking.

But in any case, have you tried, in the button script on stack 1, to (pseudocode):

close this stack --or name the stack explicitly
open the other stack --or name the stack explicitly

and the same in stack 2.

Craig Newman

Let's see if I can explain this again.

Code: Select all

on closeStack
   show stack for 10 milliseconds
   close stack
end closeStack
Yes, I've tried the above code and I get errors.

I've also tried and it doesn't work.

Code: Select all

on closeStackRequest
   show stack for 10 milliseconds
   close stack
end closeStackRequest

Last edited by shawnblc on Wed Oct 16, 2013 11:37 pm, edited 2 times in total.

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

Re: Is there a way to do this?

Post by dunbarx » Wed Oct 16, 2013 9:31 pm

Hi again.

Rereading your post, is it that you want to hide stack 1, show stack 2, and then hide stack 2 and show stack 1 again all in a single press of the button on stack 1? The following crude code is

Code: Select all

on mouseUp
   hide stack "untitled 1"
   show stack "untitled 2"
   wait 30
   hide stack "untitled 2"
   show stack "untitled 1"
end mouseUp
But I bet I have this wrong...

Craig Newman

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Is there a way to do this?

Post by shawnblc » Wed Oct 16, 2013 9:52 pm

Thanks Craig. You led me down the right road.

Post Reply