[squeak-dev] The Inbox: ToolBuilder-Morphic-ct.279.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Oct 27 07:22:33 UTC 2021


Hi Christoph --

-1 on this one. The identity check is key here. Otherwise the widget can never be sure to select the correct item. See other discussion.

#selectPath:in: is an extra interface on top of the basics to have a client-friendly way to select paths in a single call, not bothering about identity. It should not be confused with how the basic model-view communication works.


Best,
Marcel
Am 26.10.2021 20:17:08 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-ct.279.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-ct.279
Author: ct
Time: 26 October 2021, 8:16:58.339896 pm
UUID: 89094112-17a7-a848-85b0-060ddacdddd7
Ancestors: ToolBuilder-Morphic-mt.277

In PluggableTreeMorph, always compare tree items using #= rather than #==. This aligns the behavior to #selectPath:in:, which is never and already uses #=. Clients can decide theirselves how to compare items. Required for ToolBuilder-Morphic-ct.280.

For the ongoing discussion, see: http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-October/thread.html#:~:text=Item%20equality%20in%20PluggableTreeMorph

=============== Diff against ToolBuilder-Morphic-mt.277 ===============

Item was changed:
----- Method: PluggableTreeMorph>>getCurrentSelectionItem (in category 'selection') -----
getCurrentSelectionItem
"Our models are supposed to return real objects, not wrappers. See PluggableTreeItemNode."

| selectedObject |
selectedObject := self getSelectedSelector
ifNil: [^ nil]
ifNotNil: [:symbol | model perform: symbol].
^ scroller submorphs
+ detect: [:each | each complexContents item = selectedObject]
- detect: [:each | each complexContents item == selectedObject]
ifFound: [:each | each complexContents]
ifNone: [nil]!

Item was changed:
----- Method: PluggableTreeMorph>>updateFromChangedObject: (in category 'updating') -----
updateFromChangedObject: anObject

scroller submorphs
+ detect: [:morph | morph complexContents item = anObject]
- detect: [:morph | morph complexContents item == anObject]
ifFound: [:morph | self updateMorph: morph]
ifNone: ["Ignore the request. Object may not be visible anyway."].!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211027/b2bb3563/attachment.html>


More information about the Squeak-dev mailing list