[comp.windows.x.motif] Keyboard Focus

dbrooks@osf.org (David Brooks) (08/24/90)

In <several articles>, several people write:
> Use XtSetKeyboardFocus
> Use XSetKeyboardFocus

Don't code that too deep into your program.  In 1.1, use of
XtSetKeyboardFocus might break keyboard traversal.  There will be a
new routine, XmProcessTraversal, which will do the job.

In the same vein, use the Xt functions, and not the Xlib functions,
for grabbing the keyboard.
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks

slc1290@hare.udev.cdc.com (steve chesney x4662) (02/04/91)

We are using Motif 1.1 and have noticed that when we create a dialog box
(usually a dialog shell, bulletin board, list widget and push button combo),
keyboard focus is not realized until the pointer leaves the window and 
moves back into it.  We are setting keyboard focus to a list widget or a scroll
bar using process traversal.

This is particularly unfortunate due to the fact that the default button does 
not work till the keyboard focus is realized.  Thus the user has to move the
pointer out of the window, then back in to use the default button!  This 
situation occurs even if the window materializes directly beneath the pointer;
it still has to be moved out, then in again to use the keyboar for default 
button, scrolling or selection from a list widget.

This situation does not occur if there are any text or text field widgets in
the dialog box; keyboard focus is seen immediately if the pointer is in the
window.

Is this standard Motif behavior, and can I get around it?
-- 

Steve Chesney       Control Data Corporation      slc1290@hare.udev.cdc.com