Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
Widget widget;
XtPointer client_data;
XtPointer call_data;
{
Cursor cursor;
Display *display;
Widget help_widget;
XmAnyCallbackStruct *cbs, *newcbs;
XEvent *event;
cbs = (XmAnyCallbackStruct *) call_data;
display = XtDisplay (toplevel);
cursor = XCreateFontCursor (display, XC_hand2);
help_widget = XmTrackingEvent (toplevel, cursor, True, &event);
while (help_widget != NULL) {
if (XtHasCallbacks (help_widget, XmNhelpCallback) ==
XtCallbackHasSome ) {
newcbs−>reason = XmCR_HELP;
newcbs−>event = event;
XtCallCallbacks (help_widget, XmNhelpCallback,
(XtPointer) newcbs);
help_widget = NULL;
}
else
help_widget = XtParent (help_widget);
}
XFreeCursor (display, cursor);
}
When the user selects the menu item for context−sensitive help, query_for_help() is invoked. This routine calls
XmTrackingEvent() to allow the user to specify a widget on which to see help information. The confine_to
parameter is set to True, so the pointer is constrained to the window of the toplevel widget. We use toplevel
so that the user can select any component in the entire application.
XmTrackingEvent() changes the pointer to the specified cursor to provide visual feedback that the application is
in a new state. Since the user is expected to click on a object, the routine uses the XC_hand2 glyph that shows a
pointing hand. The cursor is created using XCreateFontCursor(). See Volume One, Xlib Programming
Manual, for more information.
If the user clicks on any valid widget within the application, XmTrackingEvent() returns ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431