openStack problem

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Sat Apr 17, 2010 9:21 am

openStack problem

Post by Rob van der Sloot » Sun Sep 17, 2017 10:00 pm

There is one thing about the openStack message I don't understand.

I have a main stack with a number of substacks.
With the openStack message I go to a specific layout etc.

on Openstack
show stack "....."
set the width of this stack to 781
set the height of this stack to 543
set the loc of this stack to 872,507
go to card "Login"
send "CheckStack" of card "Login"
end Openstack

Then after that the mainstack is directed to a card where there are some buttons.
These buttons are opening other substacks and go to a card of that substack and do some other tasks

on mouseUp
global gPeopleLabel, gComLabel, ctID, bgID, gBookingLabel
global gDay, gMonth, gYear
put Line 2 of field "Peoplelabel" & "," & Line 1 of field "ComLabel" into gPeoplelabel
put the label of button "Day" into gDay
put the label of button "Month" into gMonth
put the label of button "Year" into gYear
send "DiagnoseOpen" of stack "Diagnose"
end mouseUp

This works ok, but the first time I click the button, LC is going up the hierarchy and performs the OpenStack message from the mainstack. The substack screen is show in the screen of the mainstack, so there are 2 things confusing each other.
This happens after the forth command line of the script "DiagnoseOpen". This line says "show stack Diagnose".
There I don't understand why this happens and what to do to prevent this.

on DiagnoseOpen
global ctID, bgID, gPeopleLabel, gComLabel, gBookingLabel, tShow
global gDay, gMonth, gYear
lock screen
show stack "Diagnose"
......
....
end DiagnoseOpen

Please some advice on this.

thanks
Rob

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 695
Joined: Fri Feb 06, 2015 4:03 pm

Re: openStack problem

Post by LiveCode_Panos » Sun Sep 17, 2017 10:32 pm

Hi Rob,

What about putting the "openstack" handler in the first card of the mainstack? In that way, it will fire only the very first time you open your mainstack, and not every time you visit a substack of the mainstack.

Best,
Panos
--

Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Sat Apr 17, 2010 9:21 am

Re: openStack problem

Post by Rob van der Sloot » Mon Sep 18, 2017 8:24 am

Yes, that works as I wanted.
Thanks very much

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7154
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: openStack problem

Post by dunbarx » Mon Sep 18, 2017 2:46 pm

Rob.

This is common practice, to "localize" initialization processes to a certain stack. This by putting the handler in the "lowest" possible object in the message path that still does what you need, instead of what seems like the most logical place, which may be too high, too "accessible", for some purposes.

Craig Newman

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”