[Q]: Update: mechanism

thierry_reignier <thierry_Reignier at hotmail.com> thierry_Reignier at hotmail.com
Mon Dec 9 08:02:12 UTC 2002


Hi,

>> But with the new mechanism my model MUST implement aSelector.
> Easier... there are triggerEvent...ifNotHandled: [ ] variants so that 
> you don't have to check first.

I have tried it and still got an abend. I am suggesting this 
implementation: 

Object>>triggerEvent: anEventSelector
withArguments: anArgumentList
ifNotHandled: anExceptionBlock

    ^[(self 
		actionForEvent: anEventSelector
		ifAbsent: [^anExceptionBlock value])
       		valueWithArguments: anArgumentList]
				on: Error
				do: [:ex | anExceptionBlock value]

If my morph register the event but my model does not implement
it I still got the abend. I have to catch the doesNotUnderstand.

It is correct?

Thierry




More information about the Squeak-dev mailing list