[Pharo-project] how to know if an image is resuming or not

Stéphane Ducasse stephane.ducasse at inria.fr
Tue Nov 9 18:24:47 CET 2010


Issue 3222:	saveSession should return its resuming state

saveSession
	^ self snapshot: true andQuit: false

Else we lose the resuming status....


> On 9 November 2010 09:58, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
>>>> 
>>> what about using some variable, like:
>>> 
>>> RunTests := true.
>>> self saveimage.
>>> RunTests := false.
>>> self saveImage.
>>> 
>>> and then in startUp:
>>> 
>>> startUp: resuming
>>> 
>>> ( resuming and: [ RunTests] ) ifTrue: [ self runTests ]
>>> 
>> 
>> but my code is executed when a menu is selected. So the interaction with startUp: is not really good.
>> 
> 
> snapshot: save andQuit: quit embedded: embeddedFlag
> 
> answers the resuming flag.
> 
> So, you can use it like:
> 
> | resumedInFirstSnapshot |
> resumedInFirstSnapshot := false.
> 
> "first save"
> (Smalltalk snapshot: save andQuit: false) ifTrue: [ ... "resuming here
> " resumedInFirstSnapshot  := true ]
> "second save"
> (Smalltalk snapshot: save andQuit: false) ifTrue: [ ... "resuming here
> " resumedInFirstSnapshot ifFalse: [ ... ] ]
> 
> 
> 
>> Stef
>> 
>> 
>> 
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko AKA sig.
> 





More information about the Pharo-project mailing list