[FIX][BUG] Clicking in empty method/categories pane in browser

Joern Eyrich Joern.Eyrich at brokat.com
Sat Jul 7 17:44:45 UTC 2001


it seems ivar editSelection gets set to #editClass erroneously in "Browser>>messageCategoryListIndex:" which seems to expect to only be called when there is already a class selected; in this case, it is called with an argument of 0, interpreted as "the category selection was unselected and is empty now", so the browser "state" editSelection is set to #editClass, then a #changed is sent and the browser tries to display the selected class (because the state is #editClass)

Possible solution alternatives are:
(1) Browser>>messageCategoryListIndex: checks if a class is actually selected and if not sets editSelection to #none
(2) the code invoked if #editClass is set checks if any class is selected, and if not, sets editSelection to #none
(3) the click is ignored in PluggableListMorph if it does not select any entry (in this case, because the list iod empty...), thus never reaching the code setting editSelection wrongly

A cs for (3) is attached

Doug Way wrote:
> 
> Just noticed this buglet in 3.1alpha-4173.  If you open a fresh browser, and before selecting a class, you click in the method category pane or the method pane, a MNU walkback appears.  (The problem seems to be in Browser>>contents.)
> 
> This bug was not present in 3.0.
-------------- next part --------------
'From Squeak3.1alpha of 30 April 2001 [latest update: #4173] on 7 July 2001 at 7:32:24 pm'!
"Change Set:		PlgListMrph
Date:			7 July 2001
Author:			Joern Eyrich

basically, do nothing if click is not on a list entry"!


!PluggableListMorph methodsFor: 'events' stamp: 'je 7/7/2001 19:01'!
mouseUp: event
	"The mouse came up within the list; take appropriate action"

	| aMorph |
	aMorph _ self itemFromPoint: event position.
	aMorph ifNotNil: [aMorph highlightForMouseDown: false].
	model okToChange ifFalse:
		[^ self].
	(aMorph == nil) ifTrue: [^ self].  "work-around the no-mans-land bug"
	"No change if model is locked"
	((autoDeselect == nil or: [autoDeselect]) and: [aMorph == selectedMorph])
		ifTrue: [self setSelectedMorph: nil]
		ifFalse: [self setSelectedMorph: aMorph].
	Cursor normal show.
! !



More information about the Squeak-dev mailing list