Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I direct the keyboard input to a particular widget?

0
Posted

How can I direct the keyboard input to a particular widget?

0

In Motif 1.1 call XmProcessTraversal(target, XmTRAVERSE_CURRENT). The widget (and all of its ancestors) does need to be realized BEFORE you call this. Otherwise it has no effect. XmProcessTraversal is reported to have many bugs, so it may not work right. A common occurrence is that it doesn’t move to the widget, but if you call XmProcessTraversal *twice* in a row, it will. If you can’t get it to work, try this from Kee Hinckley: // This insane sequence is as follows: // On manage set up a focus callback // On focus callback set up a timer (and get rid of focus callback!) // On timer set the focus (which only works if the parent // has the focus, // which is why we went through all of this garbage) // There may be a better way, but I haven’t time to try it now. // static void focusTO(void *data, XtIntervalId *) { XmProcessTraversal((Widget) data, XmTRAVERSE_CURRENT); } static void focusCB(Widget w, XtPointer data, XtPointer) { XtRemoveCallback(w, XmNfocusCallback, focusCB, data); XtAppA

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123