[ENH] UpdatingStringMorph extensions

Stephen T. Pope stp at create.ucsb.edu
Mon Feb 28 17:44:17 UTC 2000


This changes the UpdatingStringMorph target value read/write methods to use
(e.g., ) 
	getSelector value: target scriptPerformer
instead of
	target scriptPerformer perform: getSelector
so that you can put an arbitrary block in as the "selector."
Note that this assumes the symbol-value fileIn I just sent out.

-- 

stp
  Stephen Travis Pope
  stp at create.ucsb.edu -- http://www.create.ucsb.edu/~stp
-------------- next part --------------
"Change Set:            Symbol-value
Date:                   23 Feb 2000
Author:                 Stephen Travis Pope

This changes the UpdatingStringMorph target value read/write methods to use (e.g., ) 
	getSelector value: target scriptPerformer
instead of
	target scriptPerformer perform: getSelector
so that you can put an arbitrary block in as the 'selector.'
Note that this assumes the symbol-value fileIn."

'From Squeak2.8alpha of 13 January 2000 [latest update: #1852] on 28 February 2000 at 9:21:03 am'!

!UpdatingStringMorph methodsFor: 'target access' stamp: 'stp 02/26/2000 00:02'!
informTarget

	| newValue |
	((target ~~ nil) and: [putSelector ~~ nil]) ifTrue:
		[newValue _ self valueFromContents.
		newValue ifNotNil:
			[putSelector value: target scriptPerformer value: newValue.
			target isMorph ifTrue: [target changed]].
			self fitContents.
			(owner isKindOf: TileMorph) ifTrue: [owner resizeToFitLabel]
			"self growable ifTrue:
				[self readFromTarget; fitContents.
				owner ifNotNil:  [owner updateLiteralLabel]]"]! !

!UpdatingStringMorph methodsFor: 'target access' stamp: 'stp 02/26/2000 00:01'!
readFromTarget

	| v |
	((target == nil) or: [getSelector == nil]) ifTrue: [^ contents].
	v _ getSelector value: target scriptPerformer.
	^ self acceptValueFromTarget: v! !




More information about the Squeak-dev mailing list