'From Squeak3.1alpha [latest update: #''Squeak3.1alpha'' of 28 February 2001 update 3916] on 9 April 2001 at 2:44:56 pm'! "Change Set: handMeThisObject-sw Date: 9 April 2001 Author: Scott Wallace Adds 'hand me this object' to the halo menu for (classic) object-reference tiles, which allows you to get ahold of the object to which the object refers. This will work fine whether the referent is currently in the world, or currently hidden in a 'collapsed' morph, or currently unsituated completely"! !CollapsedMorph methodsFor: 'as yet unclassified' stamp: 'sw 4/9/2001 12:53'! isMyUncollapsedMorph: aMorph "Answer whether my uncollapsed morph is aMorph" ^ uncollapsedMorph == aMorph! ! !CollapsedMorph methodsFor: 'as yet unclassified' stamp: 'sw 4/9/2001 14:23'! uncollapseToHand "Hand the uncollapsedMorph to the user, placing it in her hand, after remembering appropriate state for possible future use" | nakedMorph | nakedMorph _ uncollapsedMorph. uncollapsedMorph _ nil. nakedMorph setProperty: #collapsedPosition toValue: self position. mustNotClose _ false. "so the delete will succeed" self delete. ActiveHand attachMorph: nakedMorph! ! !CollapsedMorph class methodsFor: 'as yet unclassified' stamp: 'sw 4/9/2001 14:19'! collapsedMorphOrNilFor: anActualMorph "If there is any instance of the receiver that represents anActualMorph, answer it, else answer nil" self allInstances do: [:cm | (cm isMyUncollapsedMorph: anActualMorph) ifTrue: [^ cm]]. ^ nil! ! !TileMorph methodsFor: 'misc' stamp: 'sw 4/9/2001 14:21'! addAddHandMenuItemsForHalo: aMenu hand: aHandMorph "Add halo menu items to be handled by the invoking hand. The halo menu is invoked by clicking on the menu-handle of the receiver's halo." | aPlayer | super addAddHandMenuItemsForHalo: aMenu hand: aHandMorph. ((aPlayer _ self associatedPlayer) notNil and: [aPlayer costume isMorph]) ifTrue: [aMenu addLine. aMenu add: 'hand me this object' target: self action: #handReferentMorph. aMenu balloonTextForLastItem: 'This tile refers to an actual graphical object; use this menu item to grab that object. Caution!! This may remove the object from a place it really ought to stay.'. aMenu addLine ]! ! !TileMorph methodsFor: 'misc' stamp: 'sw 4/9/2001 12:55'! handReferentMorph "Hand the user the actual morph referred to" | aMorph surrogate | ((aMorph _ actualObject costume) isMorph and: [aMorph isWorldMorph not]) ifTrue: [surrogate _ CollapsedMorph collapsedMorphOrNilFor: aMorph. surrogate ifNotNil: [surrogate uncollapseToHand] ifNil: [ActiveHand attachMorph: aMorph]]! !