Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
aMorph openViewerForArgument
Last updated at 1:09 pm UTC on 26 September 2019
A Morph may have a Player associated with it. And that player has a viewer.


Method of a morph object (hook)

 openViewerForArgument
	"Open up a viewer for a player associated with the morph in question. "
        self presenter viewMorph: self


The presenter object is an EtoysPresenter object:

 Presenter subclass: #EtoysPresenter
	instanceVariableNames: 'associatedMorph standardPlayer standardPlayfield standardPalette playerList'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Etoys-Scripting'


However this presenter object is not much used anymore. The instance variable
standardPlayer
remains nil. You can find out about this if you put a
 self halt
into the method
openViewerForArgument
and open an Inspector on
self presenter
.

Even after you have started scripting the
standardPlayer
object variable remains nil. The player instead is held in MorphExtension.

You will find that the reference to the player object is in MorphExtension if you open an inspector or an explorer on the Morph object:


 a MorphExtension (3710149) [externalName = Ellipse ] 
 [player = a Player77 (3842439) named Ellipse]  [other:  (borderStyle -> a SimpleBorder)]

In this example
Player77
refers to the player class object which has been created for the morph object. It is a subclass of Player. These classes are hidden in the regular SystemBrowser.