Login  Register

Re: Bloc Space within a Space

Posted by Aliaksei Syrel on Feb 14, 2016; 3:29pm
URL: https://forum.world.st/Bloc-Space-within-a-Space-tp4877474p4877480.html

I'm not sure I understand what you want to archive with provided code :)
Space is not something you want to embed in another space. Space manages UI thread, event fetching, alarms and many other low level stuff. Universe contains spaces and there can be only one running space at a time - read there can be only one active UI thread and event fetcher in the system.
Check Bloc-Core-Universe. Alain put a lot of effort writing class docs.

Please, could you explain in more detail your idea and provide some examples where embedding of spaces could be applicable?

This makes real testing possible, prevents another global
mess, and makes other /really/ exciting possibilities within reach
Why?

You can create a separate 'Bloc-Test' space and do testing there.
testSpace := BlUniverse default defaultSpaceClass new identifiedBy: 'Bloc-Test'.
BlUniverse default addNewSpace: testSpace.
BlUniverse default switchToSpace: testSpace.



Cheers,
Alex

On Sun, Feb 14, 2016 at 3:47 PM, Sean P. DeNigris <[hidden email]> wrote:
I always wanted to do this in Morphic, but it made too many assumptions about
the World's environment e.g. use of globals like ActiveHand and World. I
gave it a shot (see below). The new space did appear in the current world,
but the rectangle seemed to open in the container world, not in the new
world because when I closed the new space via the halo the rectangle
remained. For me, it is very important to have a space easily create-able
and drivable. This makes real testing possible, prevents another global
mess, and makes other /really/ exciting possibilities within reach. Can it
be done in Bloc? If not, what would it take?

s := BlBlocSpace new.
root := s rootElement.
root extent: 500 @ 500.
root
        openInWorld;
        yourself.
rect := BlElement exampleRectangle.
rect openInWorld: root world.
s redraw.
root updateDrawing.



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Bloc-Space-within-a-Space-tp4877474.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.