[comp.windows.x.motif] Highlighting text fields upon entering

saint@mitchell.hac.com (Kathy Saint) (12/08/90)

I have several text fields that I have just set up as tab groups so that
the user can use <TAB> to go from field to field.  I'm having problems getting
the text in the field just entered to be highlighted(selected).
My purpose is to allow the user to directly replace the current text with
the next keystroke instead of having to double click the mouse.

I've tried using XmTextSetSelection() within an XmNfocusCallback function,
but this doesn't work.

Any suggestions?

Thanks in advance.

raney@boulder.Colorado.EDU (Scott Raney) (12/12/90)

Using the focus callback won't work (you can't distinguish tabbing to
the field from clicking in it).  The only answer is to override the
tab translations.  Unfortunately Motif 1.0's translation (and
tabgroup) stuff is so broken I was never able to get it to work.  With
1.1, you should be able to override the tab translation, then do the
XmSelect stuff in your own action handler.

Why OSF didn't design the widget to operate this way in the first
place (as the Mac and MS-Windows equivalents do) is beyond me.  There
are going to be a lot of user interface inconsistencies because of
this weakness.

Scott
======================================================================
Scott Raney                            No other person or organization
raney@gabor.colorado.edu               can be held responsible for my
(303)499-9855                                opinions or actions