[comp.windows.x.motif] -- Traversal & scrolling

Uucp@resq.fidonet.org (Uucp) (03/26/91)

From  uunet!osf.org!motif-talk-request
From: uunet!esacs!ferrara
To:   motif-talk@osf.org (Motif Talk)
Date: Wed, 20 Mar 91 17:44:28 ITA


Some time ago, Kee was discussing about traversal and I agreed with his
statement that traversal code and Layout must be independent.

We also need more functionality to interact with focus.

Currently we have the following two problems due to the traversal:

- We want to introduce a prompt_line on the bottom of our windows that
  contains some extra description about "current field" (field with focus);
  This is easy to do with text field (focusin callback set the prompt,
  focus out reset).
  For toggle,push and controls we must play with translation/action
   (installing if there is no one, using XtActionHook if not)

  Of course, ActionHook is not so nice for performance issue; anyway
  you must know if the widgets is interested in focus for translations
  AND THIS DOES NOT WORK FOR GADGET.

  Can Osf suggest something to me?

- We have windows with a lot of fields;
  Currenlty, if you tab from the last visible field into a scrollable
  window, you go to the first visible field .

  It is VERY VERY USEFUL according to our customer that we must scroll
  the window and put the focus on the "next logical field".

  I realize that the application must be involved in some way to resolve
  how to scroll to the next field (i.e.: MINIMUN_SCROLLING, CENTERING_FIELD,
  SCROLL_TO_ALIGN_LEFT, SCROLL_PAGE, ....,SCROLL_NONE=as_is_now)

  I cannot replace all the traversal code (we must work without bug on 1.1.1
  and XmProcessTraversal does not seem to work) but I do not see
  an easy way to do this.

  What I must do? Fix XmProcessTraversal and work with my motif version,
  remove all traversal code and replace with something more "neutral"
  (not so rich, but working) or waiting for a Motif version working
  with R4 that solve my problems?

Giancarlo
uunet!i2unix!esacs!ferrara
  
--  
Uucp - via FidoNet node 1:269/133
UUCP: uunet!resq!Uucp

bni@modulex.dk (Bent Nielsen) (03/28/91)

Uucp@resq.fidonet.org (Uucp) writes:
-- stuff deleted --
>- We have windows with a lot of fields;
>  Currenlty, if you tab from the last visible field into a scrollable
>  window, you go to the first visible field .

>  It is VERY VERY USEFUL according to our customer that we must scroll
>  the window and put the focus on the "next logical field".

>  I realize that the application must be involved in some way to resolve
>  how to scroll to the next field (i.e.: MINIMUN_SCROLLING, CENTERING_FIELD,
>  SCROLL_TO_ALIGN_LEFT, SCROLL_PAGE, ....,SCROLL_NONE=as_is_now)

>  I cannot replace all the traversal code (we must work without bug on 1.1.1
>  and XmProcessTraversal does not seem to work) but I do not see
>  an easy way to do this.

>  What I must do? Fix XmProcessTraversal and work with my motif version,
>  remove all traversal code and replace with something more "neutral"
>  (not so rich, but working) or waiting for a Motif version working
>  with R4 that solve my problems?

I had the problem as you describe here and my solution are the following:

I change to translation for TAB and Shift-TAB for the widgets in the scrolled
window.

In these translations I scroll the window by handling the scrollbars and use
XmProcessTraversal(widget, XmTRAVERSE_CURRENT) together with
XtSetKeyboardFocus().

The reason why I also is using XtSetKeyboardFocus() is that XmProcessTraversal
will NOT allways move the focus on a invisible widget (I have read that using
XtSetKeyboardFocus in Motif will confuse traversal, but in my case it's
working)

If you want I can e-mail you some sample code.

--
Bent Nielsen		<bni@modulex.dk>
A/S MODULEX		Phone:    +45 44 53 30 11
Lyskaer 15		Telefax:  +45 44 53 30 74
DK-2730 Herlev
Denmark