Questions about capi list panels.
I have some questions about the following code.
Please cut and paste it in the LWW listener to clarify
the questions.
(capi:contain
(make-instance 'capi:list-panel
:items '("a1" "a2" "a3")
:action-callback
(lambda (&rest args)
(capi:contain
(make-instance 'capi:list-panel
:items '("b1" "b2" "b3"))))))
The following assumes you are running the above
example code, and the first window is displayed.
First, hold down the "a" key, with autorepeat causing
it to send a sequence of "a" characters. Notice the
behavior. It's normal behavior for a list panel. At
this point, stop and press the return key, which
brings up the 2nd window. Pause for a second or more,
then do the same autorepeat, but with the "b" key.
Again, normal behavior for a list panel.
Now close the 2nd window and this time do it faster,
with no significant pause before the first "b".
Notice the difference? Can anyone explain it?
If you don't notice any difference, let me clarify the
action a little: There are two ways to do it, and
each shows different behavior. Both ways, you invoke
the 2nd window with the return key, within a fraction
of a second after the last "a". But, the first way,
you pause after that, for a second or more. The 2nd
way, you proceed immediately, such that your first
keystroke in the 2nd window happens within a fraction
of a second after the 2nd window is visible.
All I want is to understand exactly what is causing
the difference in behavior, and what I can do to
prevent that difference.
If someone has a solution, could you please send me a
modified version of the above code, such that the
behavior becomes the same regardless of the pause?
I suspect it might have something to do with the way a
list-panel accumulates keystrokes. A pause tells it
you want to discard your previous keystrokes and start
a new search. But in this case, the 2nd list panel
was created immediately before the first keystroke in
it, so a pause before that keystroke should have no
effect, as it should start a new search regardless.
Or are the two list panels somehow interfering with
each other?
__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/