[Cuis-dev] Accessing World in a start up sequence

Juan Vuletich juan at cuis.st
Mon May 29 11:27:29 PDT 2023


On 5/25/2023 9:52 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> Unfortunately, the code below called from a start up sequence does not 
> work:
>
> backgroundImage
> "WorldMorph allInstances first"
>   UISupervisor  whenUIinSafeState:  [
>     UISupervisor  ui
>        backgroundImageData:(DrGeoSystem  backgroundsPath  files  atRandom:  (Random  seed:  Time  now  nanoSecond))binaryContents]
>
> However when coded as below, it works:
>
> backgroundImage
> 	WorldMorph  allInstances  first  backgroundImageData:  	
> 		(DrGeoSystem  backgroundsPath  files
> 			atRandom:  (Random   seed:  Time  now  nanoSecond))binaryContents
>
> Strange
>
> Le 24/05/2023 à 22:29, Juan Vuletich a écrit :
>> You can't access the World, because it is not running yet during 
>> startup. Maybe what you need to do can be scheduled to be done after 
>> startup finishes?
>>
>> Seem for example #snapshot:andQuit:embedded:clearAllClassState: Many 
>> thins are done #whenUIinSafeState:

Hi Hilaire,

Class startup is done before morphic startup. You could do it like this: `[

	UISupervisor  whenUIinSafeState:  [set background image ]
] forkAt: 30`

Doing it like this, it will ask for it on the first morphic sleep.


HTH,
Juan Vuletich

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230529/d0f838e8/attachment.htm>


More information about the Cuis-dev mailing list