Mantis - Squeak
|Viewing Issue Advanced Details|
|ID:||Category:||Severity:||Reproducibility:||Date Submitted:||Last Update:|
|7096||Morphic||minor||always||06-16-08 04:31||06-18-08 00:41|
|ETA:||none||Fixed in Version:|
|Summary:||0007096: PluggableListMorph>>mouseUp: sets index to 0|
I'm not sure about the "minor;" this problem results in an exception being thrown, and the fix is probably non-trivial given the history of these methods. It is fairly easy to work around the problem in the code of the model for the PluggableListMorph. It seems to me, however, that the model should not be receiving indices of 0 in the first place.
I clicked on a row that was already selected and got an error because of an attempt to access my model list at index 0. I *did* want the selection to be communicated back to the model; the row was selected by default, and the user click indicated it was the right selection.
"The mouse came up within the list; take appropriate action"
| row mdr |
row := self rowAtLocation: event position.
event hand hasSubmorphs ifFalse: [
mdr := self mouseDownRow.
self mouseDownRow: nil.
mdr ifNil: [^self]].
(self enabled and: [model okToChange])
ifFalse: [^ self].
"No change if model is locked or receiver disabled"
row == self selectionIndex
ifTrue: [(autoDeselect ifNil: [true]) ifTrue:[row == 0 ifFalse: [self
changeModelSelection: 0 "!!!!"] ]]
ifFalse: [self changeModelSelection: row].
Cursor normal show
I marked the spot with "!!!!". This leads to the index setter being
called with argument 0 on the underlying model, which produces an error.
The PluggableListMorph (actually, PluggableListMorphPlus, but that's not
where the method is implemented) was built by ToolBuilder.
|Steps To Reproduce:|
There have been several bugs about the double-click behavior of items in lists, and various code changes as a result. The implementation of doubleClick: explicitly tests for an index of 0. Note that I was not double-clicking and not interested in the double-click behavior.
I'm using Damien's sq3.10-7159dev08.06.1.zip.
ls 5/16/2001 22:28 ¥ PluggableListMorph ¥ events ¥ 6 implementors ¥ in no change set
according to OB, and
gvc 8/7/2007 12:45 ¥ PluggableListMorph ¥ *Pinesoft-Widgets-override ¥ 53 implementors ¥ only in