PluggableListMorphs

Andrew P. Black black at cs.pdx.edu
Sat Dec 9 05:21:35 UTC 2006


Does anyone out there understand how PluggableListMorphs are supposed  
to work?

In the System Browser, if a Class Category is selected in the first  
pane, and you click it, it de-selects.  In the third pane, if a  
message protocol is selected and you click it, it de-selects.  In the  
fourth pane, if a method is selected and you click it, it deselects.

However, in the second pane, if a class name is selected and you  
click it, nothing happens.

Why is this.  Well  it turns out to be because an instance variable  
called "autoDeselect" is false.  (The default is true).

In Browser>>buildMorphicClassList it says:

	myClassList := PluggableListMorph new
	...
	myClassList doubleClickSelector: #browseSelectionInPlace.
	"For doubleClick to work best disable autoDeselect"
	myClassList autoDeselect: false .
	^myClassList

In PluggableListMorph>>mouseUp: evt it says:

mouseUp: event
	"The mouse came up within the list; take appropriate action"
	| row |
	row := self rowAtLocation: event position.
	...
	row == self selectionIndex
		ifTrue: [(autoDeselect ifNil: [true]) ifTrue:[row == 0 ifFalse:  
[self changeModelSelection: 0] ]]
		ifFalse: [self changeModelSelection: row].
	Cursor normal show

Setting row to 0 leaves nothing selected in the list.  But self  
changeModelSelection: 0 seems not to change the selection at all.   
Strange.

I can't figure this out.  autoDeselect seems like it should be called  
isDeselectionPossible; there is nothing "auto" about manually  
clicking on a selection to deselect it.  But I see no reason why the  
ability to double-click a selection should have anything to do with  
whether deselection is possible. I do know that it used to be: when  
you tried to double-click a selected item (as in the inspector, to  
spawn another inspector) the selection would be cancelled.  I  
regarded this as a bug in the implementation of double-click, which  
(I think) sent a doubleClick event and then a mouseUp event.  Is the  
problem here that rather than fix the doubleClick bug, we have  
introduced a second bug (not being able to unselect the current  
selection in the class-list pane)?

Can anyone shed any light?

	Andrew






More information about the Squeak-dev mailing list