Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpcc05!hpsciz!masa From: masa@hpsciz.sc.hp.com (Masayoshi Habu) Newsgroups: comp.windows.x Subject: Re: focus on motif text widgets Message-ID: <1310004@hpsciz.sc.hp.com> Date: 19 Apr 91 16:22:06 GMT References: <9104162100.AA00388@hydro.Saic.COM> Organization: Hewlett-Packard, Santa Clara, CA Lines: 35 In comp.windows.x, converse@expo.lcs.mit.EDU (Donna Converse) writes: > 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" Motif has its own knowledge on the keyboard focus. Thus moving focus with Xt functions are prohibited. If you have Motif 1.1 or later, you should have XmProcessTraversal() which lets you move the focus to your desired place. If you have Motif 1.0, this functions was an internal one, so *officially* you can't call it. Because Motif 1.1 is different from Motif 1.0, migrating to Motif 1.1 is recommended. The syntax and usage of XmProcessTraversal() [in Motif 1.1] is: #include Boolean XmProcessTraversal(widget, direction) Widget widget; int direction; widget Specifies the widget ID of the widget whose hierarchy is to be traversed direction Specifies the direction of traversal If you give XmTRAVERSE_CURRENT to direction and your target widget to widget parameter, the focus goes to your target. Other direction includes: XmTRAVERSE_DOWN, XmTRAVERSE_HOME, XmTRAVERSE_LEFT, XmTRAVERSE_NEXT, XmTRAVERSE_NEXT_TAB_GROUPm XmTRAVERSE_PREV, XmTRAVERSE_PREV_TAB_GROUP, XmTRAVERSE_RIGHT, and XmTRAVERSE_UP. Masa Habu