[Pharo-project] suspicion update: method in MorphExtension

Stéphane Ducasse stephane.ducasse at inria.fr
Sun May 1 21:20:37 CEST 2011

Hi guys

I have a problem with a PluggableButtonMorph and I end up in this 

MorpExtension>>update: aParameter 

	aParameter  ifNil: [^self].
	getLabelSelector ifNotNil: [
		aParameter == getLabelSelector ifTrue: [
			(self labelMorph respondsTo: #font)
				ifTrue: [self label: (model perform: getLabelSelector) font: self labelMorph font]
				ifFalse: [self label: (model perform: getLabelSelector)]]].
	state := self getModelState.
	(state ~= (self valueOfProperty: #lastState) or: [
	getStateSelector isNil and: [aParameter == #onOffColor]])
		ifTrue: [self color: self colorToUse.
				self setProperty: #lastState toValue: state].
	aParameter == getEnabledSelector ifTrue: [^self enabled: (model perform: getEnabledSelector)].
	getColorSelector ifNotNil: [ | cc |
		color = (cc := model perform: getColorSelector) 
			ifFalse: [
				color := cc.
				self onColor: color offColor: color.
				self changed ]].

To me it looks suspicious that MorphExtension does that for all the morph....


More information about the Pharo-project mailing list