[ENH] ListItemSelectByLetter

Doug Way dway at mat.net
Sat Sep 25 00:39:47 UTC 1999


I meant to respond to this earlier, but what with the list being down and
all...

On Tue, 7 Sep 1999, Jason McVay wrote:

> howdy!
> 
> this changeset allows you, when the focus is on a ListMorph, to hit any
> character key sans command keys and, if there is a list item that starts
> with that letter, it is highlighted. subsequent hits of the same letter 
> selects the next item in the list that starts with that character.

This works great, thanks.  It would be nice if this type of functionality
made it into the base image at some point.

I had thought about implementing this myself awhile back...  However, I
would probably implement it so that each successive character typed would
add to a current "search string", kind of like a ctrl-s search in Emacs,
if you're familiar with that.

For example, typing the letters "html-t" in the class category list would
take you directly to the category "HTML-Tokenizer".  The first "h" you
typed would take you to the first match ("HTML-Formatter"), typing the
subsequent "tml-" would stay in the same place since it still matched,
then the last "t" would skip to "HTML-Tokenizer".  (The class category
list isn't a great example for this since groups of categories have
similar prefixes.)

I think this scheme is better from a UI point of view, but it does have
one problem that yours doesn't... how does one determine when the user has
finished entering a string, and wants to search for a different item?
This could be done with a time limit, or when focus has left the pane, or
when a <return> character has been typed, or...?  Anyway, I was going to
try to implement this for Whisker at some point, so I guess we'll see what
works best.

> the caveat to this is that from now on you have to hit the command key
in
> concert with a character in order to get at the special functions.
> personally, i think having to use the command key is more natural
anyway...

I agree.  It's also more consistent with how the key commands work in the
TextMorph menus.  (I wasn't even aware than you didn't need to use
command/alt for ListMorph menu key commands until now.)

> --jason "the trying hard newbie" mcvay

Pretty darn good for a newbie. :-)  Often, the best way to learn Squeak is
by doing.

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com
  dway at mat.net, @eai.com





More information about the Squeak-dev mailing list