Developing a Splash Screen...

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

Developing a Splash Screen...

Nelson Pingitore
I am attempting to add a Splash Screen to a Pharo project.  I currently use the following to bring up the image:
 

(ImageReadWriter formFromFileNamed: 'C:\Users\npingito\Documents\Smalltalk\Splash Screen\splash.bmp') asMorph openInWorld
 
my question is, how can I close this image after a delay, such as after 10 seconds, and is there a better construct to use?
 
Nelson
Reply | Threaded
Open this post in threaded view
|

Re: Developing a Splash Screen...

Stéphane Ducasse

On Apr 8, 2012, at 5:31 AM, Nelson Pingitore wrote:

> I am attempting to add a Splash Screen to a Pharo project.  I currently use the following to bring up the image:
>  
>
> (ImageReadWriter formFromFileNamed: 'C:\Users\npingito\Documents\Smalltalk\Splash Screen\splash.bmp') asMorph openInWorld
>  
> my question is, how can I close this image after a delay, such as after 10 seconds, and is there a better construct to use?



[Delay forSeconds: 5.
image delete.] fork

?
>  
> Nelson


Reply | Threaded
Open this post in threaded view
|

Re: Developing a Splash Screen...

Bernat Romagosa
A tiny correction:

[ (Delay forSeconds: 5) wait.
image delete ] fork.

You may wanna do this in the #startUp method of your class, and register it to the startup list by doing Smalltalk addToStartUpList: YourClass.

Cheers!

2012/4/8 Stéphane Ducasse <[hidden email]>

On Apr 8, 2012, at 5:31 AM, Nelson Pingitore wrote:

> I am attempting to add a Splash Screen to a Pharo project.  I currently use the following to bring up the image:
>
>
> (ImageReadWriter formFromFileNamed: 'C:\Users\npingito\Documents\Smalltalk\Splash Screen\splash.bmp') asMorph openInWorld
>
> my question is, how can I close this image after a delay, such as after 10 seconds, and is there a better construct to use?



[Delay forSeconds: 5.
image delete.] fork

?
>
> Nelson





--
Bernat Romagosa.