[Pharo-dev] looking at the code of PasteUpMorph
stephane.ducasse at inria.fr
Thu Jun 27 04:05:58 EDT 2013
I really want to see this happening.
I want to pair program with ben friday.
On Jun 27, 2013, at 9:46 AM, plantec <alain.plantec at yahoo.com> wrote:
> Hi all,
> After a lot of freezes :)
> To create a new world and make it be the current world,
> thanks to PasteUpMorph>>install methods and to the MultiWorld code of sean (found in the bugtracker),
> I've implemented PasteUpMorph>> beCurrentWorld.
> Now I guess we are able to design a new clean world class and switch to it more smoothly :)
> PasteUpMorph subclass: #WorldMorph
> instanceVariableNames: ''
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Morphic-Worlds'.
> (Smalltalk at: #WorldMorph) new beCurrentWorld.
> But, I don't understand everything.
> maybe something is missing or bad.
> maybe part of this code is not useful.
> It would be cool is someone could comment this code that we understand and make it cleaner.
> PasteUpMorph>> beCurrentWorld
> | morphs |
> owner := nil.
> morphs := World submorphs.
> self class shutDown.
> worldState := WorldState new.
> self addHand: HandMorph new.
> self borderWidth: 0.
> self viewBox: Display boundingBox.
> self borderWidth: 0. "default"
> self color: self class defaultWorldColor.
> self addAllMorphs: morphs.
> SystemWindow noteTopWindowIn: self.
> World := self.
> ActiveWorld := self.
> ActiveHand := self hands first. "default"
> ActiveEvent := nil.
> worldState handsDo: [:h | h releaseCachedState].
> Sensor startUp.
> self class startUp.
> self displayWorldSafely.
> Le 26 juin 2013 à 15:41, Stéphane Ducasse <stephane.ducasse at inria.fr> a écrit :
>> I think that it would be good to have
>> PasteUpMorph (a morph in which we can drop morph)
>> subclass World (the world = a morph in which we can drop morph and that have a worldstate)
>> This would remove a lot of ifNil: everywhere.
More information about the Pharo-dev