How does the quick scroll work in OmniBrowser's columns?

David Röthlisberger squeak at c3com.ch
Thu May 3 13:06:15 UTC 2007


Hi Damien,

> In OB you can hit a key with the mouse over a column and the selection
> will go to the 1st item whose name starts with the letter you typed.
> Quickly typing a few letters will jump to the 1st item with that
> prefix.
> 
> I'd like to add that to the OB Universe Browser, but it doesn't seem
> to be a command in OB-Standard... how does it work ?

This is standard behavior of PluggableListMorph which is used by OB to display all 
nodes of an OBColumn. See method #basicKeyPressed: aChar in class PluggableListMorph.

> PS. in OB this works in the columns for packages, protocols and
> methods, but not in the class column (it briefly blinks in black
> instead).

I think this is a bug that it doesn't work for classes. I checked the method 
#basicKeyPressed: a bit, the fourth last line reads:

nextSelection := self getList findFirst: [:a | a == nextSelectionText].

Changing '==' to '=' solves the problem for me.
The reason is that the elements of the columns are symbols for packages, protocols 
and methods, but for classes they are Texts. That's why the condition '==' never 
evaluates to true, since the nodes are always newly generated when invoking #getText. 
A symbol with the same content is always the same object, so there the condition 
evaluates to true for the correct node, but this is not hold for Texts.

So maybe you are also using Texts for the nodes in the OB Universe Browser?

Kind regards,
David




More information about the Squeak-dev mailing list