[Q]: Update: mechanism

Thierry Reignier thierry_reignier at hotmail.com
Mon Dec 2 14:56:06 UTC 2002


Hi,

I have been looking at the new event-triggering mechanism
alias #when:send:to: and #trigger: and have 2 questions.

Question 1:
-----------
What is the use of the "with:" part in when:send:to:with: as
well as the "withArguments:" part in when:send:to:withArguments: ?
since when I register my interest I don't have a clue
what parameter I shall pass. I just know what selector to pass
in "send:"

Example: I want a morph to signal a selection by passing the
selected item to my model. During initialisation of my morph I
would call:
   self when: #itemSelected send: #selectItem: to: aModel with: ??
and when the morph handles the selection it sends:
  self trigger: #itemSelected with: self seletedMorph model

but here I did not use the "with:" part of the when:.... and
it worked when I tried it.

Question 2:
-----------
with the old mechanism (change: aSelector and update: aSelector)
my model did not need to implement aSelector if the
corresponding check was not implemented in the update: method.

But with the new mechanism my model MUST implement aSelector.
Why not checking if my model "respondsTo: aSelector" in
when:send: ... , if not then do not register it ... to give the
same funtionality as the old mechanism?

I get problem when integreting my work in SimpleHierarchicalListMorph
with Categorical SM loader for example.

Thierry



_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




More information about the Squeak-dev mailing list