Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ora!bloom-beacon!dont-send-mail-to-path-lines From: vania@osf.ORG (Vania Joloboff) Newsgroups: comp.windows.x Subject: Re: focus on motif text widgets Message-ID: <9104181322.AA06496@osf.osf.org> Date: 18 Apr 91 13:22:48 GMT References: <9104171458.AA07989@excess.lcs.mit.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 31 > From: converse@expo.lcs.mit.edu (Donna Converse) > > > Can anyone out there tell me how I can set the input focus to > a particular instance of a motif text widget? > > See the Xt specification, section 7.3, "Focusing Events on a Child" > > Optimally, yes; in practice the Xt routines don't work and further confuse > things. There are various Xm routines (documented and undocumented) which > work more reliably. > > In case anyone is confused, they work fine for the Athena widget set. > Perhaps I should refrain from answering questions when Motif is used! :-) > Motif has a keyboard traversal model that allows to navigate between the various widgets from the keyboard, a la Windows. It is not appropriate to use the Xt functions to set the focus, because it by-passes the Xm function. On later keyboard actions Motif will have a wrong idea of the current state. The right function to use is XmProcessTraversal. To traverse to a widget : XmProcessTraversal(widget, XmTRAVERSE_CURRENT) Note that it only works if the specified widget is traversable. Otherwise it will set focus to the first traversable widget in the same tab group.