Stack style property

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
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Stack style property

Post by phaworth » Thu Sep 10, 2009 3:46 am

I guess I'm not understanding how the stye property of a stack works.

What I want to achieve is that the main stack of my app is opened as a pallette - it's a menu for accessing all the other elements of the app. All the other substacks in the app should be opened as top level.

I have one main stack and a half dozen substacks of that main stack. The openStack handler for the main stack sets the style of "this stack" to palette. Works fine.

The menu card which is in pallete style has several buttons I click on to get to the other substacks with straight go to stack commands, no mention of any style. Yet when I click on a button, the stack I go to is opened in pallette mode, not toplevel.

It appears that the style of the main stack is inherited by the substacks? Seems a little strange to me but could someone please let me know how I can achieve what I'm trying to do?

Thanks,
Pete

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Sep 10, 2009 5:58 am

It's not the style that is inherited, it's the openStack message that travels from the substack to the mainstack script when any substack is opened. It's not a bug, it's a feature; you can read up on the message path in this excellent article.
The simplest way around this is to move the openStack handler from the mainstack script to the script of the first card of your mainstack.

HTH,

Jan Schenkel.


(edited to fix BBCode for the article URL)
Last edited by Janschenkel on Thu Sep 10, 2009 1:31 pm, edited 1 time in total.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Thu Sep 10, 2009 6:01 am

OK, got it, thanks Jan.
Pete

Post Reply