[BUG] Update of PluggableListMorphs doesn't work as expected

Bob Arning arning at charm.net
Sat Apr 22 20:50:53 UTC 2000


On Sat, 22 Apr 2000 21:46:15 +0200 Stephan Rudlof <sr at evolgo.de> wrote:
>I've found a curious update bug while implementing d&d for standard
>browsers.
>
>Recipe to generate the bug in a few minutes:
>
>- go into a morphic project,
>- open a Browser,
>- select a system category,
>- click twice to get the string morph,
>- open an Inspector by its menu (red halo)
>- evaluate
>	self color: Color black
>in it,
>- select another category (one click for activating the window, second
>click for selecting).
>
>Then updating the list morph doesn't work correctly.
>
>Try to
>- reselect StringMorph with Inspector win,
>- evaluate
>	self color: Color gray
>in Inspector,
>- select another category.
>
>Now updating works as expected. It seems to arise only for Color black.
>
>
>Any ideas?

Stephan,

That's because the PluggableListMorph unhighlights the previous selection by:

unhighlightSelection
	selectedMorph ifNotNil: [selectedMorph color: Color black]

Since the morph was red when selected, this change invalidates the rectangle and causes it to be redrawn (both the text color by the StringMorph and the selection highlighting by the list itself). But, if you set the selected morph to black *while* it is still selected, then the unhilight code will not actually change anything and thus not mark that area as needing redraw. The method above could, I suppose, ensure that the bounds of the StringMorph are marked as changed just to be safe.

Cheers,
Bob





More information about the Squeak-dev mailing list