the hilitedLine of list field isn't highlighted

Slava Paperno slava at lexiconbridge.com
Sun Jun 5 01:19:18 EDT 2011


I have a list field ("MyListField") with a rawKeyDown handler that tells me
which line is the hilitedLine after every key press.

on rawKeyDown parKey
  put return & the hilitedLine of me after msg
  pass rawKeyDown parKey
end of rawKeyDown

When I press the Up Arrow and Down Arrow keys, I see in the message box that
the hilitedLine is changing as expected, but the actual highlight in the
field is not moving: the top line always remains highlighted.

The listBehavior property is true.

This weird behavior starts when I use this command:

focus on field "MyListField"

By contrast, when I place the focus in "MyListField" by clicking it with the
mouse, everything works fine. This is all very consistent. So using the
"focus on" command is somehow not equivalent to clicking in the list field?
The focus is sort of there but not all there? Do I have to do something else
besides the "focus on" command?

What I am trying to achieve is an emulation of a combobox (because the real
combobox in LC, being a hybrid of a field and a button, doesn't work with
Unicode texts). So I have a single-line input field and below it a hidden
list field. When the user presses the down arrow in the input field, these
two lines are executed:
 
show field "ListField"
focus on field "MyListField"

That's when trouble starts. What am I doing wrong? 

LC 4.6.1, Windows 7 64-bit.

Slava






More information about the use-livecode mailing list