How to trigger (execute) code at startup of the image
Hello, Does anybody know how to execute code at startup of the image? Something like returnFromSnapshot in vw Thanks in advance, Georges
Hi George,
On 26 May 2017, at 10:44, Georges Kerssies <gkgobith@gmail.com> wrote:
Hello,
Does anybody know how to execute code at startup of the image? Something like returnFromSnapshot in vw
Thanks in advance,
Georges
Check out the class SessionManager and its references/usages. SessionManager default addDeferredStartupAction: [ ... ] Sven
On Fri, May 26, 2017 at 10:44:56AM +0200, Georges Kerssies wrote:
Hello,
Does anybody know how to execute code at startup of the image? Something like returnFromSnapshot in vw
Thanks in advance,
Georges
Sven answered the question for code already in the image. If you're talking about automatically executing a file, take a look at the StartupPreferences package. And as a simple example, try the following startup.st: StartupPreferencesLoader default executeAtomicItems: { StartupAction name: 'Startup Example' code: [ 42 inspect. ] runOnce: false. } Cheers, Alistair
Thanks Sven and Alistair for your answers. I will try them both :) Georges -- View this message in context: http://forum.world.st/How-to-trigger-execute-code-at-startup-of-the-image-tp... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (4)
-
Alistair Grant -
Georges -
Georges Kerssies -
Sven Van Caekenberghe