[Pharo-project] suspicion update: method in MorphExtension
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
Another thing I saw at PluggableButtonMorph: if you bring up the context menu and click on "show actions", a walkback comes up that PluggableButtonMorph does not understand #target. Regards, Markus 2011/5/1 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Hi guys
I have a problem with a PluggableButtonMorph and I end up in this
On Sun, May 1, 2011 at 10:26 PM, Markus Fritsche < fritsche.markus@googlemail.com> wrote:
Another thing I saw at PluggableButtonMorph:
if you bring up the context menu and click on "show actions", a walkback comes up that PluggableButtonMorph does not understand #target.
When you see things like that, please open a ticket :)
Regards, Markus
2011/5/1 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Hi guys
I have a problem with a PluggableButtonMorph and I end up in this
-- Mariano http://marianopeck.wordpress.com
Stef, Em 01/05/2011 16:20, Stéphane Ducasse < stephane.ducasse@inria.fr > escreveu:
Hi guys I have a problem with a PluggableButtonMorph and I end up in this MorpExtension>>update: aParameter
It seems to me it has more than what you suspect. . . There are variables called "getLabelSelector, getStateSelector and getColorSelector" or are "self" missing there? All these tests with if<something> are also very _not_ OO :-| Also, I think my low understanding of Morph in general may be skewing my reasoning, but it seems to me that this method would get better if some knowledgeable person could comment the code! my 0.01999999
|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....
-- Cesar Rabak
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@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.
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@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.
participants (5)
-
csrabak@bol.com.br -
Igor Stasenko -
Mariano Martinez Peck -
Markus Fritsche -
Stéphane Ducasse