focus

focus

Post by vertig » Thu, 27 Nov 2003 06:23:15


Hello
i press button, system call CallBack procedure, and on the end of that
procedure i want to set focus on other widget, so that after clicking on
that button focus automaticly move to other widget. How can i do it ?
I tried to:
Arg args[ 1 ];
XtSetArg( args[ 0 ], XmNinitialFocus,wantfocus_widget);
XtSetValues(wantfocus_parent_widget,args,1);

but it did not helped. Why ?

Thanx
 
 
 

focus

Post by Frode Tenn » Fri, 28 Nov 2003 00:45:13


XSetInputFocus()

-Frode

--
^ Frode Tenneb | email: XXXX@XXXXX.COM ^
| Ericsson AS., N-1788 Halden | Phone: +47 67 25 09 39 |
| with Standard.Disclaimer; use Standard.Disclaimer; |

 
 
 

focus

Post by vertig » Fri, 28 Nov 2003 05:14:04


i tried it too but it does not work.
i called:
XSetInputFocus(XtDisplay(want_focus_widget),XtWindow(want_focus_widget),
RevertToParent,CurrentTime);

as the last function in button callback, but after clicking that button
he still has focus :(

Why ?
How can i setfocus to other widget from callback function ?

Thanx
 
 
 

focus

Post by JF Meze » Fri, 28 Nov 2003 06:42:37


This seems to deal at the window level, not the widget level.

You may wish to look into:

XtSetKeyboardFocus

Note that the doc I have says that the change happens only at the next
keyboard event. I haven't tried this (yet).
 
 
 

focus

Post by Frode Tenn » Sat, 29 Nov 2003 20:12:33


Sorry, my bad. Provided you have set up the tab-group you could
use XmProcessTraversal.

-Frode

--
^ Frode Tenneb | email: XXXX@XXXXX.COM ^
| Ericsson AS., N-1788 Halden | Phone: +47 67 25 09 39 |
| with Standard.Disclaimer; use Standard.Disclaimer; |