'From etoys2.1 of 26 July 2007 [latest update: #1576] on 2 September 2007 at 9:02:11 pm'! "Change Set: chooseGraphicFix-sw Date: 2 September 2007 Author: Scott Wallace Fixes the bug that a second request for 'choose new graphic' for a sketchMorph for which a graphical-menu was already put up (in place of the original sketch) would generate an error. Thanks to Kathleen Harness for reporting the bug."! !Morph methodsFor: 'menus' stamp: 'sw 9/2/2007 19:04'! chooseNewGraphicCoexisting: aBoolean "Allow the user to choose a different form for her form-based morph" | replacee aGraphicalMenu | self isInWorld ifFalse: "menu must have persisted for a not-in-world object." [aGraphicalMenu := ActiveWorld submorphThat: [:m | (m isKindOf: GraphicalMenu) and: [m target == self]] ifNone: [^ self]. ^ aGraphicalMenu show; flashBounds]. aGraphicalMenu := GraphicalMenu new initializeFor: self withForms: self reasonableForms coexist: aBoolean. aBoolean ifTrue: [self primaryHand attachMorph: aGraphicalMenu] ifFalse: [replacee := self topRendererOrSelf. replacee owner replaceSubmorph: replacee by: aGraphicalMenu]! ! !GraphicalMenu methodsFor: 'accessing' stamp: 'sw 9/2/2007 19:02'! target "Answer the receiver's target." ^ target! !