'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 31 July 2003 at 6:29:47 pm'! "Change Set: AddTargetMenuToSimpleButtonMorph Date: 31 July 2003 Author: stephane ducasse Add the possibility to enter the target of a simpleButtonMorph as an expression"! !SimpleButtonMorph methodsFor: 'menu' stamp: 'sd 7/31/2003 18:26'! addCustomMenuItems: aCustomMenu hand: aHandMorph super addCustomMenuItems: aCustomMenu hand: aHandMorph. self addLabelItemsTo: aCustomMenu hand: aHandMorph. (target isKindOf: BookMorph) ifTrue: [aCustomMenu add: 'set page sound' action: #setPageSound:. aCustomMenu add: 'set page visual' action: #setPageVisual:] ifFalse: [aCustomMenu add: 'change action selector' action: #setActionSelector. aCustomMenu add: 'change arguments' action: #setArguments. aCustomMenu add: 'change when to act' action: #setActWhen. aCustomMenu add: 'change target' action: #setTarget. (self world rootMorphsAt: aHandMorph targetOffset) size > 1 ifTrue: [aCustomMenu add: 'set target' action: #setTarget:]]! ! !SimpleButtonMorph methodsFor: 'menu' stamp: 'sd 7/31/2003 18:26'! setTarget | newLabel | newLabel := FillInTheBlank request: 'Enter an expression that create the target' initialAnswer: 'World'. newLabel isEmpty ifFalse: [self target: (Compiler evaluate: newLabel)]! !