[Pharo-project] suspicion update: method in MorphExtension

Stéphane Ducasse stephane.ducasse at inria.fr
Sun May 1 22:15:18 CEST 2011


Exactly this is what I see now

update: aParameter 

	|state|
	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 ]].

The debugger was showing to me MorphExtension and in fact the method was in PluggableButtonMorph.
Now I cannot reproduce it of course....


Stef


On May 1, 2011, at 11:10 PM, Igor Stasenko wrote:

> Hey, where you got that?
> In my image (
> Pharo1.3a
> Latest update: #13097
> )
> there is no such method (MorphExtension>>#update: ) at all.
> 
> 
> On 1 May 2011 21:20, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
>> Hi guys
>> 
>> I have a problem with a PluggableButtonMorph and I end up in this
>> 
>> MorpExtension>>update: aParameter
>> 
>>        |state|
>>        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....
>> 
>> Stef
>> 
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko AKA sig.




More information about the Pharo-project mailing list