[comp.windows.x.motif] XmList question

sy18337@fmrco (Terry Traub) (05/17/91)

This is a question regarding XmList in Motif 1.0, X11R4 on SParcStations.

I am using Motif listboxes in Browse Select mode to display some
rather long lists.  I would like to let the user page through the list
with keypad commands PgUp, PgDn, Home, and End, but only the Up and
Down arrows are supported.

I added a KeyPress event handler to intercept these other keystrokes, and
it works pretty well, except that when I do an XmListSelectPos(w, 1, True) 
(followed by XmListSetPos(w, 1)) to home the list, the reverse video bar
moves to the desired location (1, in this case) but the highlight box stays
where it was, and pressing Up or Down causes the reverse video bar to jump
back down to the original location (one up or one down, actually).

The question is, how do you force the listbox to completely reset to
the position you want?  Clearly XmListSetPos() is not enough, though
the documentation suggests otherwise.

Also, does Motif 1.1.1's list box have this added functionality?  I hope there's
a painless solution; our users, and I too for that matter, are accustomed
to MS Windows' list boxes, which have much better keyboard support built in.

Thanks for any help!!!

Terry Traub
Fidelity Investments
uunet!fmrco!lanyard!ttraub

sy18337@fmrco (Terry Traub) (05/24/91)

In article <1991May16.190348.22823@fmrco> sy18337@fmrco.UUCP (Terry Traub) writes:
>This is a question regarding XmList in Motif 1.0, X11R4 on SParcStations.
>
>I am using Motif listboxes in Browse Select mode to display some
>rather long lists.  I would like to let the user page through the list
>with keypad commands PgUp, PgDn, Home, and End, but only the Up and
>Down arrows are supported.
>
>I added a KeyPress event handler to intercept these other keystrokes, and
>it works pretty well, except that when I do an XmListSelectPos(w, 1, True) 
>(followed by XmListSetPos(w, 1)) to home the list, the reverse video bar
>moves to the desired location (1, in this case) but the highlight box stays
>where it was, and pressing Up or Down causes the reverse video bar to jump
>back down to the original location (one up or one down, actually).
>
>The question is, how do you force the listbox to completely reset to
>the position you want?  Clearly XmListSetPos() is not enough, though
>the documentation suggests otherwise.
>
>Also, does Motif 1.1.1's list box have this added functionality?  I hope there's
>a painless solution; our users, and I too for that matter, are accustomed
>to MS Windows' list boxes, which have much better keyboard support built in.
>
>Thanks for any help!!!
>
>Terry Traub
>Fidelity Investments
>uunet!fmrco!lanyard!ttraub


Update:  I implemented PageUp and PageDown by sending a bunch of Up Arrow
and Down Arrow keyPress events.  But it's rather slow.  Please, oh
please (loud, nasal whine), doesn't _anyone_ know how to change the position
in an XmList?  Do I really have to buy the source code to figure this out?

Terry Traub
Fidelity Investments
uunet!fmrco!lanyard!ttraub