Re: Strange closeStack behavior

2021-10-04 Thread Bob Sneidar via use-livecode
Okay, so I've come up with a relatively simple way to go about this. The 
problem is that when in standalone mode, closeStack does not close the splash 
stack, so the app keeps running even though there are no open windows, so I 
need to quit when the mainStack closes. 

But in Development mode, I don't want to quit because THEN Livecode quits, so I 
need to use close stack. 

So I put this code in the Mainstack's script and it seems to do the trick. 

on closeStackRequest
   put getParentStack(the long id of the target) into tParentStack
   
   if the short name of the target is "Main" then
  dispatch resetMainForm to the target
   else
  dispatch "clearForm" to tParentStack
   end if
   
   save stack tParentStack
   
   if the environment is not "Development" then
  send "quit" to me in 0 seconds
   else
  send "close stack tParentStack" to me in 0 seconds
   end if
   
   pass closeStackRequest
END closeStackRequest

BOB S
 

> On Oct 4, 2021, at 14:14 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Got it thanks. That explains why I cannot even trap for closeStackRequest int 
> othe substack script. The really odd thing is I can in the message box enter 
> "close stack Time Calculator" and it closes without even bothering to ask if 
> I want to save it, even when it is "dirty". 
> 
> I was thinking of checking the dirty flag on idle, with a constant or 
> property to enable or disable auto save, then check for the dirty flag on 
> idle + time delay and auto save the stack. 
> 
> This really is only an issue with development. It's a hassle to switch to the 
> pointer tool, save the substack then switch back to the browse tool. 
> 
> I complained about this behavior a couple times, but there really is no 
> graceful way to do this without some kind of a kludge. 
> 
> Thanks for the suggestion. 
> 
> Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Strange closeStack behavior

2021-10-04 Thread Bob Sneidar via use-livecode
Got it thanks. That explains why I cannot even trap for closeStackRequest int 
othe substack script. The really odd thing is I can in the message box enter 
"close stack Time Calculator" and it closes without even bothering to ask if I 
want to save it, even when it is "dirty". 

I was thinking of checking the dirty flag on idle, with a constant or property 
to enable or disable auto save, then check for the dirty flag on idle + time 
delay and auto save the stack. 

This really is only an issue with development. It's a hassle to switch to the 
pointer tool, save the substack then switch back to the browse tool. 

I complained about this behavior a couple times, but there really is no 
graceful way to do this without some kind of a kludge. 

Thanks for the suggestion. 

Bob S


> On Oct 4, 2021, at 10:46 , J. Landman Gay via use-livecode 
>  wrote:
> 
> On 10/4/21 12:14 PM, Bob Sneidar via use-livecode wrote:
>> The stack in question is the only substack of a couple without a custom 
>> menu, so I am wondering if the last stack with a custom menu becomes the 
>> topStack??
> 
> If there is no custom menu then LC's menu takes over, and that's the one that 
> triggers the dialog. You might be able to solve the problem by using a custom 
> menu without much in it, maybe just File and Edit menus.
> 
> If you're going to build a standalone then the problem shouldn't happen there 
> at all.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Strange closeStack behavior

2021-10-04 Thread J. Landman Gay via use-livecode

On 10/4/21 12:14 PM, Bob Sneidar via use-livecode wrote:

The stack in question is the only substack of a couple without a custom menu, 
so I am wondering if the last stack with a custom menu becomes the topStack??


If there is no custom menu then LC's menu takes over, and that's the one that triggers the 
dialog. You might be able to solve the problem by using a custom menu without much in it, maybe 
just File and Edit menus.


If you're going to build a standalone then the problem shouldn't happen there 
at all.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Strange closeStack behavior

2021-10-04 Thread Bob Sneidar via use-livecode
So my only solution I can come up with to keep this from happening is to 
disable the Close Window control, then add a button that saves the stack then 
closes it. It's ugly, but what else can I do. For my part, if a stack is a 
substack of a mainstack and I close it, the Save dialog should not present 
itself. I say that because if I manually save the substack, the splash dialog 
seems to indicate it is saving the mainstack and under it the list of all the 
substacks. 

Bob S


> On Oct 4, 2021, at 09:49 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Okay, so I went through every closeStack and closeStackRequest handler in ALL 
> my stacks and libraries and commented out the handlers. The problem persists. 
> The stack in question is the only substack of a couple without a custom menu, 
> so I am wondering if the last stack with a custom menu becomes the topStack?? 
> 
> Bob S
> 
> 
>> On Oct 4, 2021, at 08:30 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Ohhh good suggestion I'll do that. 
>> 
>> Bob S
>> 
>> 
>>> On Oct 4, 2021, at 06:30 , Craig Newman via use-livecode 
>>>  wrote:
>>> 
>>> Hi.
>>> 
>>> Maybe just before the closeStackRequest line, ask for the topStack. Is it 
>>> possible  the mainStack is somehow in front?
>>> 
>>> Craig
>>> 
 On Oct 1, 2021, at 6:22 PM, Bob Sneidar via use-livecode 
  wrote:
 
 Hi all. 
 
 Very strange. I have a substance belonging to a mainstack that has LOTS of 
 other sub stacks. Only on this ONE substack, when I click the close button 
 (the red dot in the upper left of a MacOS window) it asks me if I want to 
 ave the stack, EVEN THOUGH I have a closeStackRequest in the stack script 
 that saves the stack before passing closeStackRequest. 
 
 If I don't save, or if I do save, the MAINSTACK closes, NOT just the 
 substack! If I cancel nothing happens. 
 
 What the.??? 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your 
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Strange closeStack behavior

2021-10-04 Thread Bob Sneidar via use-livecode
Okay, so I went through every closeStack and closeStackRequest handler in ALL 
my stacks and libraries and commented out the handlers. The problem persists. 
The stack in question is the only substack of a couple without a custom menu, 
so I am wondering if the last stack with a custom menu becomes the topStack?? 

Bob S


> On Oct 4, 2021, at 08:30 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Ohhh good suggestion I'll do that. 
> 
> Bob S
> 
> 
>> On Oct 4, 2021, at 06:30 , Craig Newman via use-livecode 
>>  wrote:
>> 
>> Hi.
>> 
>> Maybe just before the closeStackRequest line, ask for the topStack. Is it 
>> possible  the mainStack is somehow in front?
>> 
>> Craig
>> 
>>> On Oct 1, 2021, at 6:22 PM, Bob Sneidar via use-livecode 
>>>  wrote:
>>> 
>>> Hi all. 
>>> 
>>> Very strange. I have a substance belonging to a mainstack that has LOTS of 
>>> other sub stacks. Only on this ONE substack, when I click the close button 
>>> (the red dot in the upper left of a MacOS window) it asks me if I want to 
>>> ave the stack, EVEN THOUGH I have a closeStackRequest in the stack script 
>>> that saves the stack before passing closeStackRequest. 
>>> 
>>> If I don't save, or if I do save, the MAINSTACK closes, NOT just the 
>>> substack! If I cancel nothing happens. 
>>> 
>>> What the.??? 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Strange closeStack behavior

2021-10-04 Thread Bob Sneidar via use-livecode
Ohhh good suggestion I'll do that. 

Bob S


> On Oct 4, 2021, at 06:30 , Craig Newman via use-livecode 
>  wrote:
> 
> Hi.
> 
> Maybe just before the closeStackRequest line, ask for the topStack. Is it 
> possible  the mainStack is somehow in front?
> 
> Craig
> 
>> On Oct 1, 2021, at 6:22 PM, Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Hi all. 
>> 
>> Very strange. I have a substance belonging to a mainstack that has LOTS of 
>> other sub stacks. Only on this ONE substack, when I click the close button 
>> (the red dot in the upper left of a MacOS window) it asks me if I want to 
>> ave the stack, EVEN THOUGH I have a closeStackRequest in the stack script 
>> that saves the stack before passing closeStackRequest. 
>> 
>> If I don't save, or if I do save, the MAINSTACK closes, NOT just the 
>> substack! If I cancel nothing happens. 
>> 
>> What the.??? 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Strange closeStack behavior

2021-10-04 Thread Craig Newman via use-livecode
Hi.

Maybe just before the closeStackRequest line, ask for the topStack. Is it 
possible  the mainStack is somehow in front?

Craig

> On Oct 1, 2021, at 6:22 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> Hi all. 
> 
> Very strange. I have a substance belonging to a mainstack that has LOTS of 
> other sub stacks. Only on this ONE substack, when I click the close button 
> (the red dot in the upper left of a MacOS window) it asks me if I want to ave 
> the stack, EVEN THOUGH I have a closeStackRequest in the stack script that 
> saves the stack before passing closeStackRequest. 
> 
> If I don't save, or if I do save, the MAINSTACK closes, NOT just the 
> substack! If I cancel nothing happens. 
> 
> What the.??? 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode