Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!mips!pacbell.com!att!cbnewsm!mls From: merlyn@attunix.att.com (Steve Humphrey) Newsgroups: comp.windows.x Subject: Re: Moving keyboard focus in OpenLook Message-ID: <1991May29.203410.5641@cbnewsm.att.com> Date: 29 May 91 20:34:10 GMT References: <12958@sybase.sybase.com> Sender: mls@cbnewsm.att.com (mike.siemon) Organization: AT&T Bell Laboratories Lines: 32 In article <12958@sybase.sybase.com> clint@olias.sybase.com (Doug Clinton) writes: > I have an application which needs to assign keyboard focus to a > specific OpenLook text widget in a form widget. I have tried using > XtCallAcceptFocus(), OlCallAcceptFocus() and OlMoveFocus(). > > All of these assign keyboard focus to the desired widget but suffer > from the drawback that keyboard input is immediately directed to that > widget regardless to whether the pointer is in the application window > or not. > > So what I am looking for is a way of indicating to the form that input > focus should be directed to a particular child widget the next time > the application gets focus, but not to grab it immediately. Set the XtNfocusWidget on the top-level shell of the application. This resource is implemented by an extension to the (MIT) VendorShell widget. > I have also tried XtSetKeyboardFocus() passing the form as the subtree > and the text widget as the destination. This assigns the focus within > the app without immediately grabbing keyboard input, however I then > find that the normal traversal mechanisms no longer work and I cannot > set focus to any of the other text widgets either by tabbing or > selecting. We found that XtSetKeyboardFocus is broken, and were forced to use the Xlib version. Don't use this routine. Steve Humphrey UNIX System Laboratories