Re: [Pharo-project] how to know if an image is resuming or not
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. Stef
On 9 November 2010 09:58, Stéphane Ducasse <stephane.ducasse@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.
participants (2)
-
Igor Stasenko -
Stéphane Ducasse