[comp.windows.x.motif] Help on Context

wtm%gr.utah.edu@cs.utah.edu (Thomas McCollough) (01/09/91)

Someone mentioned help with regard to the Style Manual.  I have a
similar question.  I am interested in implementing Help on Context as
described in section 8.1.1 of the Style Manual.  Briefly, from that
section:

	"Using the mouse, people can use the On Context entry in the
	Help menu.  The pointer shape changes to the Help pointer
	shape.  Selecting a field with the Help pointer displays help
	on that field.  After the selection, the Help pointer returns
	to its previous shape.  To cancel the context-sensitive help
	mode, users press <Esc>."

What would be the most straight-forward way of programming this
functionality?  I am using version 1.0.

Thanks,
Tom McCollough
wtm@gr.utah.edu

tbray@watsol.waterloo.edu (Tim Bray) (01/09/91)

wtm%gr.utah.edu@cs.utah.edu (Thomas McCollough) writes:
>I am interested in implementing Help on Context as
>described in section 8.1.1 of the Style Manual.
>
>What would be the most straight-forward way of programming this
>functionality?  I am using version 1.0.

Not sure this is optimal, but it works:

1. Immediately stop using Motif 1.0, go to 1.1.
2. Grab the pointer via XGrabPointer from the topmost window, also changing
   and confining the cursor - one call does it all.
3. Wait for the next ButtonPress with XMaskEvent.
4. Figure out which user-perceived application component the ButtonPress 
   happened in. (HIGHLY application-dependent)
5. Ungrab the pointer.
6. Provide help for the appropriate component.

Cheers, Tim Bray, tbray@watsol.waterloo.edu

bonnett@seismo.CSS.GOV (H. David Bonnett) (01/09/91)

In article <12334.663393239@hplnpm.hpl.hp.com>, mayer@HPLNPM.HPL.HP.COM (Niels P. Mayer) writes:
|> From: tbray@watsol.waterloo.edu (Tim Bray)
|> > wtm%gr.utah.edu@cs.utah.edu (Thomas McCollough) writes:
|> > >I am interested in implementing Help on Context 
|> Another alternative, if you're using 1.1, is the following:
|> 
|> |           Widget XmTrackingLocate (widget, cursor, confine_to)
|> |                Widget    widget;
|> |                Cursor    cursor;
|> |                Boolean   confine_to;
|> | ...
|> |          XmTrackingLocate provides a modal interface for selection of
|> |           a component.  It is intended to support context help.  The
|> |           function grabs the pointer and returns the widget in which a
|> |           button press occurs.
|> | ...
|> 

Thank you Niels for pointing out the solution to a problem that myself
and others (Kee, Ana Swenson etc) have been looking for.  NO THANK YOU
to OSF for not mentioning this anywhere in the Motif Programmer's Guide
(to stupid little trivia without value....) 
As others have said: This thing (Prog Guide) SUCKS THE BIG ONE. [no ;-) ]


Just a little steam being blown off..

-dave bonnett;Center for Seismic Studies, Arlington, VA
      bonnett@seismo.css.gov-

 

mikey@sgi.com (Mike Yang) (01/10/91)

In article <49314@seismo.CSS.GOV> bonnett@seismo.CSS.GOV (H. David Bonnett) writes:
>Thank you Niels for pointing out the solution to a problem that myself
>and others (Kee, Ana Swenson etc) have been looking for.  NO THANK YOU
>to OSF for not mentioning this anywhere in the Motif Programmer's Guide
>(to stupid little trivia without value....) 
>As others have said: This thing (Prog Guide) SUCKS THE BIG ONE. [no ;-) ]

XmTrackingLocate is new to Motif 1.1.  Therefore, it's documented in
my 1.1 Programmer's Reference but not my 1.0 version.

What version of the Programmer's Guide do you have?  I don't have the
Programmer's Guide, but I agree that it belongs in the 1.1 version,
if it's not already in it.

-----------------------------------------------------------------------
                 Mike Yang        Silicon Graphics, Inc.
               mikey@sgi.com           415/335-1786