Running startup scripts after the UI has finished

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Running startup scripts after the UI has finished

Peter Uhnak
Hi,

is it possible to execute startup scripts after the UI has finished rendering / the image has loaded?

I have install startup script that executes when I create the image, however since it starts executing very early the UI is frozen and I don't get any progress bar so I don't know what's happening (since I'm downloading Roassal and other libraries it can take quite a while.)

Thanks,
Peter
Reply | Threaded
Open this post in threaded view
|

Re: Running startup scripts after the UI has finished

EstebanLM
Smalltalk addDeferredStartupAction: aBlock.

aBlock will be executed after startup, as the comment says:

"Add the monadic or nulladic block to the list of actions that we will be performed immediately after the startup is totally executed.”

and

World defer: aBlock

aBlock will be executed in the next UI rendering cycle, as the comment DOES NOT says (because is missing) ;)

So I think the first one, or the two combined will give you the solution.

cheers,
Esteban

> On 10 Mar 2015, at 18:36, Peter Uhnák <[hidden email]> wrote:
>
> Hi,
>
> is it possible to execute startup scripts after the UI has finished rendering / the image has loaded?
>
> I have install startup script that executes when I create the image, however since it starts executing very early the UI is frozen and I don't get any progress bar so I don't know what's happening (since I'm downloading Roassal and other libraries it can take quite a while.)
>
> Thanks,
> Peter


Reply | Threaded
Open this post in threaded view
|

Re: Running startup scripts after the UI has finished

Peter Uhnak
After a lot of experimenting and unsuccessful attempts to use both defer: and addDeferredStartupAction: (because I'm probably using it wrong) I ended up with

[ myCode ] fork

This has not only the wanted behavior of executing after the UI has rendered, but also doesn't freeze the UI when loading external packages. In fact the loader itself seems much responsive.

Peter

On Tue, Mar 10, 2015 at 6:45 PM, Esteban Lorenzano <[hidden email]> wrote:
Smalltalk addDeferredStartupAction: aBlock.

aBlock will be executed after startup, as the comment says:

"Add the monadic or nulladic block to the list of actions that we will be performed immediately after the startup is totally executed.”

and

World defer: aBlock

aBlock will be executed in the next UI rendering cycle, as the comment DOES NOT says (because is missing) ;)

So I think the first one, or the two combined will give you the solution.

cheers,
Esteban

> On 10 Mar 2015, at 18:36, Peter Uhnák <[hidden email]> wrote:
>
> Hi,
>
> is it possible to execute startup scripts after the UI has finished rendering / the image has loaded?
>
> I have install startup script that executes when I create the image, however since it starts executing very early the UI is frozen and I don't get any progress bar so I don't know what's happening (since I'm downloading Roassal and other libraries it can take quite a while.)
>
> Thanks,
> Peter