Lisp HUG Maillist Archive

Typing at an option pane

I'm on Windows.

I have a simple option pane, something like this:
(capi:contain
   (make-instance 'capi:option-pane
     :items '(10 11 12 13 14 15 16)))

I can click on the down arrow to drop down the list, and then move 
around with the mouse without making a selection - the item under the 
mouse is indicated by a black background, but an actual selection is 
not made until I click or hit enter.

When I type at it, it immediately makes a selection based on my typing.

Is there any way for typin to instead drop down the list and move the 
black background around, without making a selection until I click or hit enter?

Gail


Re: Typing at an option pane

On Sun, 03 Feb 2008 13:21:34 -0500, Gail Zacharias <gz@clozure.com> wrote:

> Is there any way for typin to instead drop down the list and move
> the black background around, without making a selection until I
> click or hit enter?

Works for me if I press the down arrow while holding down the Alt key.
Likewise Alt with the up arrow key folds the menu back in.  Also, I
can't confirm that typing immediately results in a selection.

However, with your example (the numbers 10 to 16) there's no way that
you can actually type, say, "12" to get at the twelve like in most
browsers.  Only the first character is honored.


Re: Typing at an option pane

At 2/3/2008 02:39 PM, Edi Weitz wrote:
>On Sun, 03 Feb 2008 13:21:34 -0500, Gail Zacharias <gz@clozure.com> wrote:
>
>> Is there any way for typin to instead drop down the list and move
>> the black background around, without making a selection until I
>> click or hit enter?
>
>Works for me if I press the down arrow while holding down the Alt key.
>Likewise Alt with the up arrow key folds the menu back in.  Also, I
>can't confirm that typing immediately results in a selection.

If I have
(capi:contain
  (make-instance 'capi:option-pane
     :items '(a b c d e f g h i j k l m n o p q r s t)
     :selection-callback #'(lambda (&rest args)
                              (format t "~&selection ~s" args))))

then when the user types "a", my selection callback gets invoked immediately. But if they click on the widget and just move the mouse around, my callback doesn't get called until I click or type.  Because in my actual code making a selection does something that takes a while (many seconds), I'd prefer to defer the selection like in the mouse case, rather than have it trigger immediately as you are typing.

I.e. I'd like it so that the selection callback doesn't get called when the user types "a" or the arrow keys, only if they click or type something that exits the widget (e.g. enter or tab).  And I'd like the widget to open up when they type "a" or arrow keys, if it's not already opened.

Barring that, is there a way to disable typin, i.e. make it so the selection callback doesn't get called on any typing, forcing the user to use the mouse to make a selection?


>However, with your example (the numbers 10 to 16) there's no way that
>you can actually type, say, "12" to get at the twelve like in most
>browsers.  Only the first character is honored.

Yes, I understand that's the windows behavior.  You type the first character repeatedly to cycle through all the choices.  But whatever the semantics of making the selection through typing, I'd like it to drop down the list and move the black background around, without invoking the callback until you exit.


Updated at: 2020-12-10 08:44 UTC