Save Stack Woes - Could someone PLEASE explain this...

Ken Ray kray at sonsothunder.com
Thu Apr 22 12:35:39 EDT 2004


Dave,

"save this stack" saves the changes to disk, not in/out of memory. If you
clicked Cancel, quit Rev and came back in and opened the stack, I'd bet the
checkbox is OFF. 

The way that many of us do this kind of thing is initialization handlers in
the preopenstack of the stack that's being opened. If it's a modal, I use
"the dialogdata" to set values I want in the dialog, for example:

on mouseUP
  set the dialogData to "true"
  modal myCheckBoxDialog
end mouseUp

-- stack "myCheckboxDialog"
on preOpenStack
  set the hilite of btn "myCheckbox" to (the dialogData)
end preOpenStack

But as to your original investigation... I think it's a bug. Here's why:
When I replicate what you did, I followed this sequence after creating the
stack, saving it to disk, closing Rev and relaunching:

1) Open the stack (checkbox is off)
2) Turn the checkbox on
3) Click "Cancel"
4) Reopen the stack -> checkbox is off [CORRECT]

1) Open the stack (checkbox is off)
2) Turn the checkbox on
3) Click "Save"
4) Reopen the stack -> checkbox is on [CORRECT]
5) Turn the checkbox off
6) Click "Cancel"
7) Reopen the stack -> checkbox is on [CORRECT]

1) Open the stack (checkbox is on)
2) Turn the checkbox off
3) Click "Save"
4) Reopen the stack -> checkbox is off [CORRECT]
5) Turn the checkbox on
6) Click "Cancel"
7) Reopen the stack -> 
     *sometimes* the checkbox is on [INCORRECT]
     *sometimes* the checkbox is off [CORRECT]

It seems to have to do with whether or not the stack was previously saved in
the same session. This was done with both destroyStack and destroyWindow
turned on.

HTH,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> David Burgun
> Sent: Thursday, April 22, 2004 5:59 AM
> To: How to use Revolution
> Subject: Save Stack Woes - Could someone PLEASE explain this...
> 
> 
> Hi,
> 
> Could some PLEASE just explain this to me! All I want to do is to 
> close a stack and sometimes save what the user has done in the GUI 
> and other times not, for instance if they Press "OK" then I want to 
> save and close the stack, if they press "Cancel" then I want to close 
> the Stack but not save it.
> 
> This is what I have in a simple modal dialog:
> 
> One Checkbox.
> One OK Button
> One Cancel Button.
> 
> In the Script for the OK button I have the following:
> 
> on mouseUp
> save this stack
> close this stack
> end mouseUp
> 
> In the Script for the Cancel button I have the following:
> 
> on mouseUp
> close this stack
> end mouseUp
> 
> I run the app under the IDE and call up the dialog, the checkbox is 
> initally off so I set it on and press the cancel button. I then call 
> up the dialog again and............... The Checkbox is ON Even though 
> I have not issued a save stack command!!!!!!
> 
> Is this supposed to happen? Is this a bug in the RunRev (v2.2 running 
> MacOS Classic and X) App?  I've played around with the destroyStack 
> and destroyWindow properties, they don't seem to do anything.
> 
> As far as I can tell, I've done everything that people on this list 
> have suggested I do in order to get this to work, and it just plain 
> doesn't and now I don't know where else to turn...........
> 
> If someone could please just explain how to do this simple operation 
> I'd would be eternally grateful!
> 
> I need the solution to work while running under the IDE and as a 
> standalone (this is a separate Stack, so it CAN be saved to, I am not 
> trying to save to a Standalone Stack).
> 
> 
> 
> One other thing, on the same subject. How do I stop the IDE putting 
> up the "This stack has not been saved" dialog? It seems that 
> *sometimes* the stack hasn't been saved (usually when I issue a close 
> from the IDE while in "Browse" mode). I am guessing that if I ever 
> get the above save/close to work that this will be my next problem, 
> but maybe not.
> 
> Anyway, I'm am totally worn out by all this, a sample stack that does 
> these very simple things is really needed IMO. As it is, RunRev is 
> great but it's taking far too much time to do these simple things. I 
> could have coded the whole window in C/C++ by now and had complete 
> control over whether or not the data was saved or not. RunRev is 
> supposed to be a productivity tool, which it is potentially, but if 
> there is no documentation and no samples to work from then it won't 
> be adopted very quickly or at all.
> 
> Sorry to sound negative and I'll most likely soon recover from it, 
> but right now it just seems like an uphill 
> struggle.....................
> 
> Thanks for all your help and advice
> Dave
> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the use-livecode mailing list