Differentiating a substack from a mainstack

Peter Haworth pete at lcsql.com
Wed Nov 20 20:29:54 EST 2013


I prowled around the IDE code for the File menu "New substack" item and
here's what happens:

*put* the short name of the topStack into tCurrentStack
*if* the mainStack of stack tCurrentStack is not tCurrentStack *then* *put*
the mainStack of stack tCurrentStack into tCurrentStack
*send* "menuPick" && quote & "New Mainstack" & quote to button "file"
*set* the mainStack of the topStack to tCurrentStack

In other words, requesting a new substack results in a new mainstack being
created then having it's mainstack set to the correct mainstack.



Pete
lcSQL Software <http://www.lcsql.com>


On Wed, Nov 20, 2013 at 4:32 PM, Peter Haworth <pete at lcsql.com> wrote:

> Richard,
> It feels like a bug to me although I think it's a timing issue more than
> anything else.  It does however make it impossible to tell whether a newly
> created stack is a main stack or a substack.
>
> Jacque,
> I'm checking in an openStack handler in a front script, also tried a
> newStack handler with the same result.  I never see your step 1 (although
> sounds like Mark does), and in your step 2 the owner is indeed empty and
> the mainstack is the name of the stack even for a substack.  Step 3 then
> manifests itself in the form of a mainStackChanged message
>
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
> On Wed, Nov 20, 2013 at 3:18 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:
>
>> On 11/20/13 4:36 PM, Peter Haworth wrote:
>>
>>> Thanks Scott.  Tried that and the owner is empty whether I'm creating a
>>> main stack or a substack.  Once again, it doesn't end up that way, just
>>> within the scope of a front script openStack/newStack handler.
>>>
>>> Maybe this is a change in how stacks are created depending on which LC
>>> version?  These tests were done using LC 5.5.4.
>>>
>>
>> I think it will depend on when you check. Logically it would go something
>> like this:
>>
>> 1. New stack is made: name is a long ID number, owner is empty
>> 2. New stack is given a name: either a passed parameter or "Untitled",
>> owner is empty
>> 3. New stack is assigned as a substack: owner is mainstack
>>
>> I wonder if messages are locked while the naming and owner assignment are
>> going on so you aren't getting all of them. How/when do you check the name?
>>
>> --
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the use-livecode mailing list