Patrick Rein uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-pre.262.mcz==================== Summary ====================
Name: ToolBuilder-Morphic-pre.262
Author: pre
Time: 9 July 2020, 3:52:09.108909 pm
UUID: 55e57017-8d67-424f-9a7b-2b64ed8af8af
Ancestors: ToolBuilder-Morphic-tpr.261, ToolBuilder-Morphic-TheresaHMartenK.261
Merge of ToolBuilder-Morphic-TheresaHMartenK.261
The current implementation searches for the supplied answer in the valueList and if found returns the value at the found index in the valueList which of course is the supplied answer. However from the behaviour that gets mimicked you would expect the implementation to look for the suppliedAnswer in the labelList - the same as you click on the label and not on its connected value. Additionally this produces less readable / understandable code compared to supplying the label, especially if the value happens to be a block.
With the new implementation, the answer is searched in the labelList, and the returned value is the coresponding value from the valueList.
=============== Diff against ToolBuilder-Morphic-tpr.261 ===============
Item was changed:
----- Method: MorphicUIManager>>chooseFrom:values:lines:title: (in category 'ui requests') -----
chooseFrom: labelList values: valueList lines: linesArray title: aString
"Choose an item from the given list. Answer the selected item."
| index |
self askForProvidedAnswerTo: aString ifSupplied: [:answer |
(answer = #cancel or: [answer isNil]) ifTrue: [^ nil].
+ ^ valueList at: (labelList indexOf: answer) ifAbsent: [
- ^ valueList at: (valueList indexOf: answer) ifAbsent: [
answer isNumber
ifTrue: [valueList at: answer ifAbsent: [nil]]
ifFalse: [nil]]].
index := self chooseFrom: labelList lines: linesArray title: aString.
^ index = 0
ifTrue: [ nil ]
ifFalse: [ valueList at: index ]!