[comp.windows.x] Motif List Widget, Help!

lyons@cdss.UUCP (Don R. Lyons x4811) (07/18/90)

Salutations netlanders!

  I am having a little difficulty with the list widget. I have
the following attributes (resources) set :
  XmNtraversalOn: TRUE
  XmNhighlightThickness: 1
  XmNhighlightOnEnter: TRUE
  XmNautomaticSelection: TRUE
  XmNselectionPolicy: XmBROWSE_SELECT

I want my users to be able to use both the key board and mouse to make
a selection. Also, when the user traverses the list with the arrow keys
a selection occurs for each list item he passes over. These items I have
programmed successfully, but I am having a problem with sync'ing the key
board and the mouse. If the user is traversing with the keyboard( making
automatic selections as he goes along), and then
uses the mouse to make a selection of a non-adjacent item, the last list
item accessed by using the keyboard remains highlighted and the item picked
with the mouse shows indicates it is selected. Now, if the user goes back to
the keyboard, the arrow keys move away from the highlighted item and not the
item selected with the mouse. Confused yet? :^) On a small list this is not
a problem, but on a large list this produces quite a bit of jump'in around.

How can I sync up the two. I have tried XmListSetPos in my selection callback
and I was not satisfied with the results. Is their a hidden attribute in the
list widget that maintains the highlighted item position. I would like not to
have to try something non-standard, but I am ready to start poking around
the list widget with Xt. If you need a visual of what I am describing,
reference the OSF/Motif Programmers Guide, Rev 1.0 :
  @figure 53, "List Widget Before Selection Action"
  @figure 54, "List Widget After Selecting Five Visible"

As always, I am working under a deadline. Would you please email your
responses.

  -don
-- 
Don R Lyons                          Any opinions expressed are my own.
Arinc Research Inc                   uucp : uunet!cdss!lyons
SRG, Mail Stop 5230                  voice: 301 266 4811
2551 Riva Road Annapolis , MD 21401  fax  : 301 266 2047