Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!seismo!bonnett From: bonnett@seismo.CSS.GOV (H. David Bonnett) Newsgroups: comp.windows.x.motif Subject: Re: Setting keyboard focus Message-ID: <49493@seismo.CSS.GOV> Date: 11 Mar 91 18:35:24 GMT References: <1991Mar7.124545@MAX7.llnl.gov> <39956@cup.portal.com> <1991Mar11.132140.18706@bellcore.bellcore.com> Sender: usenet@seismo.CSS.GOV Organization: Center for Seismic Studies, Arlington, VA Lines: 33 Ik Su Yoo writes: |> You may already know this but here is a quote from FAQ: |> |> Subject: 21) How can I direct the keyboard input to a particular widget? |> |> Answer: In Motif 1.1 call XmProcessTraversal(target, XmTRAVERSE_CURRENT). |> In Motif 1.0 call the undocumented _XmGrabTheFocus(target). Do not use the |> X or Xt calls such as XtSetKeyboardFocus since this bypasses the Motif |> traversal layer and can cause it to get confused. This can lead to |> odd keyboard behaviour elsewhere in your application. I have found that this does not work for me in the following case: I have a rather complex widget hierarchy; but not extremely so, I use a mainWindow that contains a Form passed as the work area of the main_window. Then I have a ScrolledWindow child that contains a another Form which is scrolled. It contains a group of RowColumns each of which contain either labels or Text widgets. I want to set the keyboard focus to the first text widget created, so when use the XmProcessTraversal call exactly as specified in the FAQ and I get: No focus on any of my widgets. The focus did work correctly w/o this call before I added the layers of the scrolled window and 2nd form. The resultant problem is that I grab the input on losingFocus and if the widget never gets the focus well then it can't lose it.... Any solution would be appreciated greatly. -dave bonnett- Center for Seismic Studies; Arlington, VA bonnett@seismo.css.gov : All standard disclaimers apply. -- -dave bonnett- Center for Seismic Studies; Arlington, VA bonnett@seismo.css.gov : All standard disclaimers apply.