[Pharo-project] MorphicModel needs serious cleaning
Just found that scrollbars are assigned 'slotname' when you creating them and when it comes to send events to their model, it end up in this method: use: cachedSelector orMakeModelSelectorFor: selectorBody in: selectorBlock | selector | model ifNil: [^ nil]. cachedSelector ifNil: ["Make up selector from slotname if any" selector := (slotName ifNil: [selectorBody] ifNotNil: [slotName , selectorBody]) asSymbol. (model class canUnderstand: selector) ifFalse: [(self confirm: 'Shall I compile a null response for' , Character cr asString , model class name , '>>' , selector) ifFalse: [self halt]. model class compile: (String streamContents: [:s | selector keywords doWithIndex: [:k :i | s nextPutAll: k , ' arg' , i printString]. s cr; nextPutAll: '"Automatically generated null response."'. s cr; nextPutAll: '"Add code below for appropriate behavior..."'.]) classified: 'input events' notifying: nil]] ifNotNil: [selector := cachedSelector]. ^ selectorBlock value: selector this is incredible.. -- Best regards, Igor Stasenko AKA sig.
After SmartReferenceStream, nothing surprises me :) Seriously, debuggers in front of end users and centralizing all of the conversion methods in SRS itself, rather than with the class of the object being converted. On the topic at hand, there is a lot of room to make clean use of events. One thing to watch: Dolphin makes a point of introducing comparison policies, and has some "silent" setters (that do not trigger events). I have long suspected that they are at least in part intended as a damping mechanism to avoid meltdowns that might have occurred in Dolphin's "youth." Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Igor Stasenko [siguctua@gmail.com] Sent: Monday, July 11, 2011 9:24 PM To: Pharo Development Subject: [Pharo-project] MorphicModel needs serious cleaning Just found that scrollbars are assigned 'slotname' when you creating them and when it comes to send events to their model, it end up in this method: use: cachedSelector orMakeModelSelectorFor: selectorBody in: selectorBlock | selector | model ifNil: [^ nil]. cachedSelector ifNil: ["Make up selector from slotname if any" selector := (slotName ifNil: [selectorBody] ifNotNil: [slotName , selectorBody]) asSymbol. (model class canUnderstand: selector) ifFalse: [(self confirm: 'Shall I compile a null response for' , Character cr asString , model class name , '>>' , selector) ifFalse: [self halt]. model class compile: (String streamContents: [:s | selector keywords doWithIndex: [:k :i | s nextPutAll: k , ' arg' , i printString]. s cr; nextPutAll: '"Automatically generated null response."'. s cr; nextPutAll: '"Add code below for appropriate behavior..."'.]) classified: 'input events' notifying: nil]] ifNotNil: [selector := cachedSelector]. ^ selectorBlock value: selector this is incredible.. -- Best regards, Igor Stasenko AKA sig.
:) I'm sure that there are other little gremlins that we will kill one day or the others. open a ticket. I still want to remove the setName and friend on Morph :) Stef On Jul 12, 2011, at 3:24 AM, Igor Stasenko wrote:
Just found that scrollbars are assigned 'slotname' when you creating them and when it comes to send events to their model, it end up in this method:
use: cachedSelector orMakeModelSelectorFor: selectorBody in: selectorBlock | selector | model ifNil: [^ nil]. cachedSelector ifNil: ["Make up selector from slotname if any" selector := (slotName ifNil: [selectorBody] ifNotNil: [slotName , selectorBody]) asSymbol. (model class canUnderstand: selector) ifFalse: [(self confirm: 'Shall I compile a null response for' , Character cr asString , model class name , '>>' , selector) ifFalse: [self halt]. model class compile: (String streamContents: [:s | selector keywords doWithIndex: [:k :i | s nextPutAll: k , ' arg' , i printString]. s cr; nextPutAll: '"Automatically generated null response."'. s cr; nextPutAll: '"Add code below for appropriate behavior..."'.]) classified: 'input events' notifying: nil]] ifNotNil: [selector := cachedSelector]. ^ selectorBlock value: selector
this is incredible..
-- Best regards, Igor Stasenko AKA sig.
On 12 July 2011 20:51, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
:)
I'm sure that there are other little gremlins that we will kill one day or the others.
i would say this is an elder gremlin, fat and grumpy one :)
open a ticket.
http://code.google.com/p/pharo/issues/detail?id=4513
I still want to remove the setName and friend on Morph :) Stef
-- Best regards, Igor Stasenko AKA sig.
participants (3)
-
Igor Stasenko -
Schwab,Wilhelm K -
Stéphane Ducasse