MorphicProject class openViewAndEnter:
Last updated at 3:51 am UTC on 6 December 2021
This method is called after a project file (pr file) has been loaded successfully.
The argument morphOrList is the object returned by the load process and usually contains the project PasteUpMorph instance.
openViewAndEnter: morphOrList
"morphOrList has been reconstituted from a file. Open it in an appropriate
Morphic world."
| contents |
contents := morphOrList.
(morphOrList isKindOf: SqueakPage) ifTrue: [
contents := morphOrList contentsMorph
].
(contents isKindOf: PasteUpMorph) ifFalse:
[^ self inform: 'This is not a PasteUpMorph or
exported Project.' translated].
(self openViewOn: contents) enter
openViewOn: aPasteUpOrNil
"Create a new Morphic Project and open a view for the project"
| newProject |
newProject := self new.
aPasteUpOrNil ifNotNil: [newProject installPasteUpAsWorld: aPasteUpOrNil].
ProjectViewMorph openOn: newProject.
^newProject
See also
How to create a new Morphic project with code - example 1