home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / answers / motif-faq / part5 < prev    next >
Encoding:
Internet Message Format  |  1993-10-25  |  65.3 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!medusa.hookup.net!news.kei.com!sol.ctr.columbia.edu!howland.reston.ans.net!pipex!uunet!haven.umd.edu!news.umbc.edu!cs.umd.edu!kong.gsfc.nasa.gov!vilya.gsfc.nasa.gov!not-for-mail
  2. From: dealy@kong.gsfc.nasa.gov (Brian Dealy)
  3. Newsgroups: news.answers,comp.answers
  4. Subject: Motif FAQ (Part 5 of 5)
  5. Followup-To: poster
  6. Date: 25 Oct 1993 16:09:50 -0400
  7. Organization: NASA/Goddard Space Flight Center
  8. Lines: 1896
  9. Sender: dealy@vilya.gsfc.nasa.gov
  10. Approved: news-answers-request@MIT.Edu
  11. Expires: +1 months
  12. Message-ID: <2ahbqe$110@vilya.gsfc.nasa.gov>
  13. Reply-To: dealy@kong.gsfc.nasa.gov (Brian Dealy)
  14. NNTP-Posting-Host: vilya.gsfc.nasa.gov
  15. Keywords: FAQ question answer
  16. Archive-name: motif-faq/part5
  17. Last-modified: Oct 15 1993
  18. Version: 3.6
  19. Xref: senator-bedfellow.mit.edu news.answers:13926 comp.answers:2411
  20.  
  21.  
  22.  
  23.  
  24.  
  25. -----------------------------------------------------------------------------
  26. Subject: 125)  TOPIC: ICONS
  27.  
  28. Iconification/de-iconification is a co-operative process between a client and
  29. a window manager.  The relevant standards are set by ICCCM.  Mwm is ICCCM
  30. compliant.  The toplevel (non-override-redirect) windows of an application may
  31. be in three states: WithdrawnState (neither the window nor icon visible),
  32. NormalState (the window visible) or IconicState (the icon window or pixmap
  33. visible).  This information is contained in the WM_STATE property but ordinary
  34. clients are not supposed to look at that (its values have not yet been
  35. standardised).  Movement between the three states is standardised by ICCCM.
  36.  
  37. -----------------------------------------------------------------------------
  38. Subject: 126)  How can I keep track of changes to iconic/normal window state?
  39.  
  40. Answer: You can look at the WM_STATE property, but this breaks ICCCM
  41. guidelines.  ICCCM compliant window managers will map windows in changing them
  42. to normal state and unmap them in changing them to iconic state. Look for
  43. StructureNotify events and check the event type:
  44.  
  45.         XtAddEventHandler (toplevel_widget,
  46.                         StructureNotifyMask,
  47.                         False,
  48.                         StateWatcher,
  49.                         (Opaque) NULL);
  50.         ....
  51.         void StateWatcher (w, unused, event)
  52.         Widget w;
  53.         caddr_t unused;
  54.         XEvent *event;
  55.         {
  56.                 if (event->type == MapNotify)
  57.                         printf ("normal\n");
  58.                 else if (event->type == UnmapNotify)
  59.                         printf ("iconified\n");
  60.                 else    printf ("other event\n");
  61.         }
  62.  
  63.  
  64. If you insist on looking at WM_STATE, here is some code (from Ken Sall) to do
  65. it:
  66.  
  67.         /*
  68.         ------------------------------------------------------------------
  69.         Try a function such as CheckWinMgrState below which returns one of
  70.         IconicState | NormalState | WithdrawnState | NULL :
  71.         ------------------------------------------------------------------
  72.         */
  73.         #define WM_STATE_ELEMENTS 1
  74.  
  75.         unsigned long *CheckWinMgrState (dpy, window)
  76.         Display *dpy;
  77.         Window window;
  78.         {
  79.           unsigned long *property = NULL;
  80.           unsigned long nitems;
  81.           unsigned long leftover;
  82.           Atom xa_WM_STATE, actual_type;
  83.           int actual_format;
  84.           int status;
  85.  
  86.             xa_WM_STATE = XInternAtom (dpy, "WM_STATE", False);
  87.  
  88.             status = XGetWindowProperty (dpy, window,
  89.                           xa_WM_STATE, 0L, WM_STATE_ELEMENTS,
  90.                           False, xa_WM_STATE, &actual_type, &actual_format,
  91.                           &nitems, &leftover, (unsigned char **)&property);
  92.  
  93.             if ( ! ((status == Success) &&
  94.                         (actual_type == xa_WM_STATE) &&
  95.                         (nitems == WM_STATE_ELEMENTS)))
  96.                 {
  97.                 if (property)
  98.                     {
  99.                     XFree ((char *)property);
  100.                     property = NULL;
  101.                     }
  102.                 }
  103.             return (property);
  104.         } /* end CheckWinMgrState */
  105.  
  106.  
  107. -----------------------------------------------------------------------------
  108. Subject: 127)  How can I check if my application has come up iconic?  I want
  109. to delay initialisation code and other processing.
  110.  
  111. Answer: Use XtGetValues and check for the XmNinitialState value of the
  112. toplevel shell just before XtMainLoop. -- IconicState is iconic, NormalState
  113. is not iconic.
  114.  
  115.  
  116.  
  117.  
  118. -----------------------------------------------------------------------------
  119. Subject: 128)  How can I start my application in iconic state?
  120.  
  121. Answer: From the command line
  122.  
  123.         application -iconic
  124.  
  125. Using the resource mechanism, set the resource XmNinitialState to IconicState
  126. of the toplevel shell widget (the one returned from XtInitialise).
  127.  
  128. -----------------------------------------------------------------------------
  129. Subject: 129)  How can an application iconify itself?
  130.  
  131. Answer: In R4 and later, use the call XIconifyWindow.
  132.  
  133. For R3, send an event to the root window with a type of WM_CHANGE_STATE and
  134. data IconicState.
  135.  
  136.         void
  137.         IconifyMe (dpy, win)
  138.         Display *dpy;
  139.         Window win;     /* toplevel window to iconify */
  140.         {
  141.                 Atom xa_WM_CHANGE_STATE;
  142.                 XClientMessageEvent ev;
  143.  
  144.                 xa_WM_CHANGE_STATE = XInternAtom (dpy,
  145.                                         "WM_CHANGE_STATE", False);
  146.  
  147.                 ev.type = ClientMessage;
  148.                 ev.display = dpy;
  149.                 ev.message_type = xa_WM_CHANGE_STATE;
  150.                 ev.format = 32;
  151.                 ev.data.l[0] = IconicState;
  152.                 ev.window = win;
  153.  
  154.                 XSendEvent (dpy,
  155.                         RootWindow (dpy, DefaultScreen(dpy)),
  156.                         True,
  157.                         (SubstructureRedirectMask | SubstructureNotifyMask),
  158.                         &ev);
  159.                 XFlush (dpy);
  160.         }
  161.  
  162.  
  163. -----------------------------------------------------------------------------
  164. Subject: 130)  How can an application de-iconify itself?
  165.  
  166. Answer: XMapWindow (XtDisplay (toplevel_widget), XtWindow (toplevel_widget)).
  167.  
  168. -----------------------------------------------------------------------------
  169. Subject: 131)  TOPIC: MISCELLANEOUS
  170.  
  171. -----------------------------------------------------------------------------
  172. Subject: 132)  How can I identify the children of a manager widget?
  173.  
  174. Answer: XmNnumChildren (number of widgets in array).
  175.  
  176. -----------------------------------------------------------------------------
  177. Subject: 133)  How do I tell if a scrolled window's scrollbars are visible?
  178.  
  179. Answer: Use XtGetValues() to get the scrollbar widget ID's, then use
  180. XtIsManaged() to see if they are managed (visible).
  181.  
  182. thanks to Ken Lee, klee@synoptics.com
  183.  
  184. -----------------------------------------------------------------------------
  185. Subject: 134)  How can I programatically scroll a XmScrolledWindow in
  186. XmAUTOMATIC mode?
  187.  
  188. Answer: In Motif 1.2, use XmScrollVisible().  If you're using a scrolled text
  189. or scrolled list combination widget, use XmTextScroll() or XmListSet*()
  190. instead.
  191.  
  192. The Motif manuals specifically forbid manipulating the scrollbars directly,
  193. but some people have reported success with XmScrollBarSetValues, with the
  194. "notify" parameter set to "True".
  195.  
  196. thanks to Ken Lee, klee@synoptics.com
  197.  
  198. -----------------------------------------------------------------------------
  199. Subject: 135)  What functions can an application use to change the size or
  200. position of a widget?
  201.  
  202. Answer: Applications should set the values of the XmNx, XmNy, XmNwidth, and
  203. XmNheight resources.
  204.  
  205. Note that many manager widgets ignore the XmNx and XmNy resources of their
  206. children, relying instead on their internal layout algorithms.  If you really
  207. want specific positions, you must use a manager widget that allows them, e.g.,
  208. XmBulletinBoard.
  209.  
  210. Also note that some manager widgets reject size change requests from their
  211. children when certain resources are set (e.g., XmNresizable on XmForm).
  212. Others allow the the children to resize, but clip the results (e.g.,
  213. XmNallowShellResize on shell widgets).  Make sure you have these resources set
  214. to the policy you want.
  215.  
  216. Due to bugs, some widgets (third party widgets) do not respond to changes in
  217. their width and height.  Sometimes, you can get them to respond correctly by
  218. unmanaging them, setting the resources, then managing them again.
  219.  
  220. Under no circumstances should applications use routines like
  221. XtConfigureWidget() or XtResizeWidget().  These routines are reserved for
  222. widget internals and will seriously confuse many widgets.  _ thanks to Ken
  223. Lee, klee@synoptics.com ----------
  224. -------------------------------------------------------------------
  225. Subject: 136)  What widgets should I use to get the look of push buttons, but
  226. the behaviour of toggle buttons?
  227.  
  228. Answer:
  229.   Use the XmToggleButton widget, setting XmNindicatorOn to False and
  230. XmNshadowThickness to 2.
  231.  
  232. thanks to Ken Lee, klee@synoptics.com
  233.  
  234. -----------------------------------------------------------------------------
  235. Subject: 137)  Can I use XtAddTimeOut(), XtAddWorkProc(), and XtAddInput()
  236. with XtAppMainLoop()?
  237.  
  238. Answer: On many systems, the obsolete XtAdd*() functions are not compatible
  239. with the XtAppMainLoop().  Instead, you should use newer XtAppAddTimeOut(),
  240. XtAppAddWorkProc(), and XtAppAddInput() functions with XtAppMainLoop()
  241.  
  242. thanks to Ken Lee, klee@synoptics.com ----------
  243. -------------------------------------------------------------------
  244. Subject: 138)  Why does XtGetValues() XmNx and XmNwidth return extremely large
  245. values.
  246.  
  247. Answer: You must use the 16 bit "Dimension" and "Position" data types for your
  248. arguments.  If you use 32 bit integers, some implementations will fill the
  249. remaining 16 bits with invalid data, causing incorrect return values.  The
  250. *Motif Programmer's Manual* and the widget man pages specify the correct data
  251. type for each resource.
  252.  
  253. thanks to Ken Lee, klee@synoptics.com ----------
  254. -------------------------------------------------------------------
  255. Subject: 139)  Can I specify callback functions in resource files?
  256.  
  257. Answer: To specify callbacks, you must use UIL in addition to or in place of
  258. resource files.  You can, however, specify translations in resource files,
  259. which give you most of the same functionality as callback functions.
  260.  
  261. thanks to Ken Lee, klee@synoptics.com ----------
  262. -------------------------------------------------------------------
  263. Subject: 140)  How do I specify a search path for ".uid" files?  Answer: Use
  264. the UIDPATH environment variable.  It is documented on the MrmOpenHierarchy()
  265. man page.
  266.  
  267. -----------------------------------------------------------------------------
  268. Subject: 141)  XtGetValues() on XmNx and XmNy of my top level shell don't
  269. return the correct root window coordinates.  How do I compute these?
  270.  
  271. Answer: XmNx and XmNy are the coordinates relative to your shell's parent
  272. window, which is usually a window manager's frame window.  To translate to the
  273. root coordinate space, use XtTranslateCoords() or XTranslateCoordinates().
  274.  
  275. thanks to Ken Lee, klee@synoptics.com ----------
  276. -------------------------------------------------------------------
  277. Subject: 142)  Can I use XmGetPixmap() with widgets that have non-default
  278. visual types?
  279.  
  280. Answer: If you're using a different depth, use XmGetPixmapByDepth() instead.
  281.  
  282.  thanks to Ken Lee, klee@synoptics.com ----------
  283. -------------------------------------------------------------------
  284. Subject: 143)  How can I determine the item selected in a option menu or a
  285. RadioBox?
  286.  
  287. Answer: The value of the XmNmenuHistory resource of the XmRowColumn parent is
  288. the widget ID of the last selected item.  It works the same way for all menus
  289. and radio boxes.  thanks to Ken Lee, klee@synoptics.com
  290.  
  291. -----------------------------------------------------------------------------
  292. Subject: 144)  What is the matter with Frame in Motif 1.2?
  293.  
  294. [Last modified: November 92]
  295.  
  296. Answer: This announcement has been made by OSF:
  297.  
  298. "IMPORTANT NOTICE
  299.  
  300. We have discovered two problems in the new 1.2 child alignment resources in
  301. XmFrame. Because some vendors may have committed, or are soon to commit to
  302. field releases of Motif 1.2 and 1.2.1, OSF's options for fixing them are
  303. limited. We are trying to deal with these in a way that does not cause
  304. hardship for application developers who will develop applications against
  305. various point versions of Motif. OSF's future actions for correction are
  306. summarized.
  307.  
  308. WHAT YOU SHOULD DO AND KNOW
  309.  
  310. 1. Mark the following change in your documentation.
  311.  
  312. On page 1-512 of the OSF/Motif Programmer's Reference, change the descriptions
  313. under XmNchildVerticalAlignment as follows (what follows is the CORRECT
  314. wording to match the current implementation):
  315.  
  316. XmALIGNMENT_WIDGET_TOP
  317.         Causes the BOTTOM edge of the title area to align
  318.         vertically with the top shadow of the Frame.
  319.  
  320. XmALIGNMENT_WIDGET_BOTTOM
  321.         Causes the TOP edge of the title area to align
  322.         vertically with the top shadow of the Frame.
  323.  
  324. 2. Note the following limitation on resource converters for Motif 1.2 and
  325. 1.2.1 implementations.
  326.  
  327. The rep types for XmFrame's XmNentryVerticalAlignment resource were
  328. incorrected implemented, which means that converters will not work properly.
  329. The following resource settings will not work from a resource file in 1.2 and
  330. 1.2.1:
  331.  
  332.         *childVerticalAlignment: alignment_baseline_bottom
  333.         *childVerticalAlignment: alignment_baseline_top
  334.         *childVerticalAlignment: alignment_widget_bottom
  335.         *childVerticalAlignment: alignment_widget_top
  336.  
  337. If you wish to set these values for these resources (note they are new
  338. constraint resources in XmFrame) you will have to set them directly in C or
  339. via uil.
  340.  
  341. WHAT WE WILL DO
  342.  
  343. The problem described in note #1 above will not be fixed in the OSF/Motif
  344. implementation until the next MAJOR release of Motif.  At that time we will
  345. correct the documentation and modify the code to match those new descriptions,
  346. but we will preserve the existing enumerated values and their behavior for
  347. backward compatibility for that release.
  348.  
  349. The fix for the problem described in note #2 will be shipped by OSF in Motif
  350. 1.2.2.
  351.  
  352. SUMMARY
  353.  
  354. We are sorry for any difficulty this causes Motif users.  If you have any
  355. questions or flames (I suppose I deserve it) please send them directly to me.
  356. We sincerely hope this proactive response is better for our customers than you
  357. having to figure it out yourselves!
  358.  
  359. Libby
  360.  
  361.  
  362. -----------------------------------------------------------------------------
  363. Subject: 145)  What is IMUG and how do I join it?
  364.  
  365. Answer: IMUG is the International Motif User Group founded by Quest Windows
  366. Corporation and co-sponsored by FedUNIX.  IMUG is a non-profit organization
  367. working to keep users informed on technical and standards issues, to
  368. strengthen user groups on a local level, to increase communication among users
  369. internationally, and to promote the use of an international conference as a
  370. forum for sharing and learning more about Motif.  You can join it by
  371.  
  372.  1.  Pay the annual membership fee of $20 USD directly to IMUG.  Contact
  373.  
  374.      IMUG
  375.      5200 Great America Parkway
  376.      Santa Clara,  CA  95054
  377.      (408) 496-1900
  378.      imug@quest.com
  379.  
  380.  2.  Register at the International Motif User Conference, and automatically
  381.      become an IMUG member.
  382.  
  383.  3.  Donate a pd widget, widget tool or widget builder to the IMUG Widget
  384.      Depository and receive a free one year IMUG membership.
  385.  
  386.  
  387. -----------------------------------------------------------------------------
  388. Subject: 146)  What is the X Professional Organization
  389.  
  390. [Last modified: August 93]
  391.  
  392. Answer: The X Professional Organization's (XPO) purpose is to provide service
  393. to the X community.  It will serve as an information conduit for professional
  394. users of X.  XPO will participate in X activities, and help keep its members
  395. informed on X related issues.
  396.  
  397. In addition to the communication that professional organizations offer, XPO
  398. provides these other benefits to members:
  399.  
  400.     * subscription to the The X Resource, a quarterly publication
  401.       by O'Reilly & Associates, Inc.,
  402.  
  403.     * discounts on X related products, 20% off most new books
  404.  
  405. *** For a sample issue of the newsletter,
  406. *** email  wbarker@wam.umd.edu and include your surface address:
  407.  
  408.     * the XPO quarterly newsletter featuring:
  409.          o highlights of conference activities,
  410.          o new product information,
  411.          o articles highlighting the latest innovations in X,
  412.          o feedback from developers and users of X,
  413.          o calendar of activities,
  414.          o forum for X professionals to interact and learn,
  415.          o and much more...
  416.  
  417. Membership Information:
  418. Annual pricing information in US dollars.
  419.  
  420. Associate:  Quarterly newsletter
  421. Regular: Quarterly newsletter + subscription to The X Resource
  422. Special: Regular + The X Resource  supplemental issues
  423.  
  424. Country               Associate    Regular     Special
  425. USA                     $35.00     $100.00     $120.00
  426. Canada & Mexico         $40.00     $105.00     $135.00
  427. Europe & Africa         $45.00     $125.00     $175.00
  428. Asia & Australia        $50.00     $130.00     $185.00
  429.  
  430.  
  431. Contact:  X Professional Organization, Post Office Box 78, Beltsville,
  432. Maryland, 20704  USA
  433.  
  434. Phone/fax: (410) 799-7197, email: wbarker@wam.umd.edu
  435.  
  436.  
  437.  
  438. -----------------------------------------------------------------------------
  439. Subject: 147)  How do I set the title of a top level window?
  440.  
  441. [Last modified: September 92]
  442.  
  443. Answer: Set XmNtitle (and optionally XmNtitleEncoding) for TopLevelShells.
  444. (Note that this is of type String rather than XmStrin.) Ypu can also set
  445. XmNiconName if you want its icon to show this title.  For XmDialogShells, set
  446. the XmNdialogTitle of its immediate child, assuming it's a BulletinBoard
  447. subclass.  These can also be set in resource files.
  448.  
  449.  
  450. -----------------------------------------------------------------------------
  451. Subject: 148)  Can I use editres with Motif?
  452. [Last modified: January 93]
  453.  
  454. Answer: It isn't built in to Motif (at 1.2.0), but you can do this in your
  455. application
  456.  
  457.     extern void _XEditResCheckMessages();
  458.     ...
  459.     XtAddEventHandler(shell_widget, (EventMask)0, True,
  460.                         _XEditResCheckMessages, NULL);
  461.  
  462. once for each shell widget that you want to react to the "click to select
  463. client" protocol.  Then link your client with the R5 libXmu.
  464.  
  465. David Brooks, OSF
  466.  
  467. From Marc Quinton (quinton@stna7.stna7.stna.dgac.fr):
  468.  
  469. With X11R4 see the Editres package which is a port of the X11R5 Editres
  470. protocol and client. You can find it at :
  471.  
  472.  ftp.stna7.stna.dgac.fr(143.196.9.83):/pub/dist/Editres.tar.Z
  473.  
  474. -----------------------------------------------------------------------------
  475. Subject: 149)  How can I put decorations on transient windows using olwm?
  476.  
  477. Answer: From Jean-Philippe Martin-Flatin <syj@ecmwf.co.uk>
  478.  
  479. /**********************************************************************
  480. ** WindowDecorations.c
  481. **
  482. ** Manages window decorations under the OpenLook window manager (OLWM).
  483. **
  484. ** Adapted from a C++ program posted to comp.windows.x.motif by:
  485. **
  486. **    +--------------------------------------------------------------+
  487. **    | Ron Edmark                          User Interface Group     |
  488. **    | Tel:        (408) 980-1500 x282     Integrated Systems, Inc. |
  489. **    | Internet:   edmark@isi.com          3260 Jay St.             |
  490. **    | Voice mail: (408) 980-1590 x282     Santa Clara, CA 95054    |
  491. **    +--------------------------------------------------------------+
  492. ***********************************************************************/
  493.  
  494. #include <X11/X.h>
  495. #include <X11/Xlib.h>
  496. #include <X11/Xatom.h>
  497. #include <X11/Intrinsic.h>
  498. #include <X11/StringDefs.h>
  499. #include <X11/Protocols.h>
  500. #include <Xm/Xm.h>
  501. #include <Xm/AtomMgr.h>
  502.  
  503. /*
  504. ** Decorations for OpenLook:
  505. ** The caller can OR different mask options to change the frame decoration.
  506. */
  507. #define OLWM_Header     (long)(1<<0)
  508. #define OLWM_Resize     (long)(1<<1)
  509. #define OLWM_Close      (long)(1<<2)
  510.  
  511. /*
  512. ** Prototypes
  513. */
  514. static void InstallOLWMAtoms  (Widget w);
  515. static void AddOLWMDialogFrame(Widget widget, long decorationMask);
  516.  
  517.  
  518. /*
  519. ** Global variables
  520. */
  521. static Atom AtomWinAttr;
  522. static Atom AtomWTOther;
  523. static Atom AtomDecor;
  524. static Atom AtomResize;
  525. static Atom AtomHeader;
  526. static Atom AtomClose;
  527. static int  not_installed_yet = TRUE;
  528.  
  529.  
  530. static void InstallOLWMAtoms(Widget w)
  531. {
  532.         AtomWinAttr = XInternAtom(XtDisplay(w), "_OL_WIN_ATTR" ,    FALSE);
  533.         AtomWTOther = XInternAtom(XtDisplay(w), "_OL_WT_OTHER",     FALSE);
  534.         AtomDecor   = XInternAtom(XtDisplay(w), "_OL_DECOR_ADD",    FALSE);
  535.         AtomResize  = XInternAtom(XtDisplay(w), "_OL_DECOR_RESIZE", FALSE);
  536.         AtomHeader  = XInternAtom(XtDisplay(w), "_OL_DECOR_HEADER", FALSE);
  537.         AtomClose   = XInternAtom(XtDisplay(w), "_OL_DECOR_CLOSE",  FALSE);
  538.  
  539.         not_installed_yet = FALSE;
  540. }
  541.  
  542. static void AddOLWMDialogFrame(Widget widget, long decorationMask)
  543. {
  544.         Atom   winAttrs[2];
  545.         Atom   winDecor[3];
  546.         Widget shell = widget;
  547.         Window win;
  548.         int    numberOfDecorations = 0;
  549.  
  550.         /*
  551.         ** Make sure atoms for OpenLook are installed only once
  552.         */
  553.         if (not_installed_yet) InstallOLWMAtoms(widget);
  554.  
  555.         while (!XtIsShell(shell)) shell = XtParent(shell);
  556.  
  557.         win = XtWindow(shell);
  558.  
  559.         /*
  560.         ** Tell Open Look that our window is not one of the standard OLWM window        ** types. See OLIT Widget Set Programmer's Guide pp.70-73.
  561.         */
  562.  
  563.         winAttrs[0] = AtomWTOther;
  564.  
  565.         XChangeProperty(XtDisplay(shell),
  566.                         win,
  567.                         AtomWinAttr,
  568.                         XA_ATOM,
  569.                         32,
  570.                         PropModeReplace,
  571.                         (unsigned char*)winAttrs,
  572.                         1);
  573.  
  574.         /*
  575.         ** Tell Open Look to add some decorations to our window
  576.         */
  577.         numberOfDecorations = 0;
  578.         if (decorationMask & OLWM_Header)
  579.                 winDecor[numberOfDecorations++] = AtomHeader;
  580.         if (decorationMask & OLWM_Resize)
  581.                 winDecor[numberOfDecorations++] = AtomResize;
  582.         if (decorationMask & OLWM_Close)
  583.         {
  584.                 winDecor[numberOfDecorations++] = AtomClose;
  585.  
  586.                 /*
  587.                 ** If the close button is specified, the header must be
  588.                 ** specified. If the header bit is not set, set it.
  589.                 */
  590.                 if (!(decorationMask & OLWM_Header))
  591.                         winDecor[numberOfDecorations++] = AtomHeader;
  592.         }
  593.  
  594.         XChangeProperty(XtDisplay(shell),
  595.                         win,
  596.                         AtomDecor,
  597.                         XA_ATOM,
  598.                         32,
  599.                         PropModeReplace,
  600.                         (unsigned char*)winDecor,
  601.                         numberOfDecorations);
  602. }
  603.  
  604.  
  605. /*
  606. ** Example of use of AddOLWMDialogFrame, with a bit of extra stuff
  607. */
  608. void register_dialog_to_WM(Widget shell, XtCallbackProc Cbk_func)
  609. {
  610.         Atom atom;
  611.  
  612.         /*
  613.         ** Alias the "Close" item in system menu attached to dialog shell
  614.         ** to the activate callback of "Exit" in the menubar
  615.         */
  616.         if (Cbk_func)
  617.         {
  618.             atom = XmInternAtom(XtDisplay(shell),"WM_DELETE_WINDOW",TRUE);
  619.             XmAddWMProtocolCallback(shell,atom, Cbk_func,NULL);
  620.         }
  621.  
  622.         /*
  623.         ** If Motif is the window manager, skip OpenLook specific stuff
  624.         */
  625.         if (XmIsMotifWMRunning(shell)) return;
  626.  
  627.         /*
  628.         ** Register dialog shell to OpenLook.
  629.         **
  630.         ** WARNING: on some systems, adding the "Close" button allows the title
  631.         ** to be properly centered in the title bar. On others, activating
  632.         ** "Close" crashes OpenLook. The reason is not clear yet, but it seems
  633.         ** the first case occurs with OpenWindows 2 while the second occurs with
  634.         ** Openwindows 3. Thus, comment out one of the two following lines as
  635.         ** suitable for your site, and send e-mail to syj@ecmwf.co.uk if you
  636.         ** find out what is going on !
  637.         */
  638.         AddOLWMDialogFrame(shell,(OLWM_Header | OLWM_Resize));
  639. /*      AddOLWMDialogFrame(shell,(OLWM_Header | OLWM_Resize | OLWM_Close)); */
  640. }
  641.  
  642.  
  643. -----------------------------------------------------------------------------
  644. Subject: 150)  Why does an augment translation appear to act as replace for
  645. some widgets?  When I use either augment or override translations in
  646. .Xdefaults it seems to act as replace in both Motif 1.0 and 1.1
  647.  
  648. Answer: By default, the translation table is NULL.  If there is nothing
  649. specified (either in resource file, or in args), the widget's Initialize
  650. finds: Oh, there is NULL in translations, lets use our default ones.  If,
  651. however, the translations have become non-NULL, the default translations are
  652. NOT used at all. Thus, using #augment, #override or a new table has identical
  653. effect: defines the new translations. The only way you can augment/override
  654. Motif's default translations is AFTER Initialize, using XtSetValues.  Note,
  655. however, that Motif managers do play with translation tables as well ... so
  656. that results are not always easy to predict.
  657.  
  658. From OSF: A number of people have complained about not being able to
  659. augment/override translations from the .Xdefaults.  This is due to the
  660. complexity of the menu system/keyboard traversal and the necessary
  661. translations changes required to support the Motif Style Guide in menus.  It
  662. cannot be fixed in a simple way. Fixing it requires re-design of the
  663. menus/buttons and it is planned to be fixed in 1.2.
  664.  
  665.  
  666.  
  667.  
  668.  
  669. -----------------------------------------------------------------------------
  670. Subject: 151)  How do you "grey" out a widget so that it cannot be activated?
  671.  
  672. Answer: Use XtSetSensitive(widget, False). Do not set the XmNsensitive
  673. resource directly yourself (by XtSetValues) since the widget may need to talk
  674. to parents first.
  675.  
  676.  
  677. -----------------------------------------------------------------------------
  678. Subject: 152)  Why doesn't the Help callback work on some widgets?
  679.  
  680. Answer: If you press the help key the help callback of the widget with the
  681. keyboard focus is called (not the one containing the mouse).  You can't get
  682. the help callback of a non-keyboard-selectable widget called. To get `context
  683. sensitive' help on these, you have to find the mouse, associate its position
  684. with a widget and then do the help.
  685.  
  686.  
  687.  
  688. -----------------------------------------------------------------------------
  689. Subject: 153)  Where can I get a Table widget?
  690.  
  691. [Last modified: December 92]
  692.  
  693. Answer: Send email to Kee Hinckley (nazgul@alfalfa.com) asking for a copy of
  694. his table widget.  The Widget Creation Library also has one.  See under Motif
  695. prototyping tools for the contact.
  696.  
  697. Expert Database Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.
  698. Phone: (212) 783-6981 has a very comprehensive table widget that uses both
  699. motif scrollbars or a "virtual" scrollbar showing a miniature version of the
  700. entire spreadsheet. Allows for different width columns, changing colors in
  701. each cell.  Only one X-Window is used so as to reduce the amount of system
  702. resources used.  Contact Ken Jones email: ken@mr_magoo.sbi.com)
  703.  
  704.  
  705. -----------------------------------------------------------------------------
  706. Subject: 154)  Has anyone done a bar graph widget?
  707. [Last modified: September 92]
  708.  
  709. Answer: You can fake one by using for each bar a scroll bar or even a label
  710. which changes in size, put inside a container of some kind.
  711.  
  712. Try the StripChart widget in the Athena widget set. Set the XtNupdate resource
  713. to 0 to keep it from automatically updating.
  714.  
  715. The comp.windows.x FAQ mentions a bar graph widget.
  716.  
  717. Expert Database Systems, Inc.  sells a bar graph widget as well as a multi-
  718. line graph with automatic scaling, a 3-D surface graph, and a high/Low graph
  719. with two lines for moving averages.  Contact Ken Jones Expert Database
  720. Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.  Phone: (212)
  721. 783-6981
  722.  
  723.  
  724. The Xtra XWidget library contains a set of widgets that are subclassed from
  725. and compatible with either OSF/Motif or OLIT widgets.  The library includes
  726. widgets that implement the following:
  727.  
  728.    Spreadsheet
  729.    Bar Graph
  730.    Stacked Bar Graph
  731.    Line Graph
  732.    Pie Chart
  733.    XY Plot
  734.    Hypertext
  735.    Hypertext based Help System
  736.    Entry Form with type checking
  737.  
  738. Contact Graphical Software Technology at 310-328-9338  (info@gst.com) for
  739. information.
  740.  
  741. The XRT/graph widget, available for Motif, XView and OLIT, displays X-Y plots,
  742. bar and pie charts, and supports user-feedback, fast updates and PostScript
  743. output. Contact KL Group Inc. at 416-594-1026 (xrt_info%klg@uunet.ca)
  744.  
  745. The product Xmath, made by Integrated Systems Inc. is a product which has
  746. interactive 2d and 3d graphics for bar,strip,line,symbol,
  747. surface,contour,etc... that costs $2500.00 for commercial use and a mere
  748. $250.00 for university use that also has complete numerics capabilities, an
  749. easy to use debugger, a complete high level language, a spreadsheet, a motif
  750. gui access capability, and much more all created on top of motif.
  751.  
  752. You can either email to xmath-info@isi.com or call (408)980-1500.
  753.  
  754. Digital Equipment Corporation (DEC) provides the following product NetEd: "The
  755. network editor widget is a Motif toolkit conforming widget that applications
  756. can use to express complex interrelationships graphically in the form of
  757. networks or graphs. The network editor supports interactive or application-
  758. controlled creation and editing of directed graphs or networks."
  759.  
  760.  
  761. ACE/gr is an X based XY plotting tool implemented with a point 'n click
  762. paradigm.  A few of its features are:
  763.  
  764.    * Plots up to 10 graphs with 30 data sets per graph.
  765.    * Data read from files and/or pipes.
  766.    * Graph types XY, log-linear, linear-log, log-log, bar,
  767.         stacked bar charts.
  768.  
  769. it is available from
  770.  
  771.         ftp.ccalmr.ogi.edu (presently amb4.ccalmr.ogi.edu)
  772.  
  773. with IP address 129.95.72.34. The XView version (xvgr) will be found in
  774. /CCALMR/pub/acegr/xvgr-2.09.tar.Z and the Motif version (xmgr) in
  775. /CCALMR/pub/acegr/xmgr-2.09.tar.Z.  Comments, suggestions, bug reports to
  776. pturner@amb4.ccalmr.ogi.edu (if mail fails, try pturner@ese.ogi.edu). Due to
  777. time constraints, replies will be few and far between.
  778.  
  779.  
  780.  
  781. -----------------------------------------------------------------------------
  782. Subject: 155)  Does anyone know of a source code of a graph widget where you
  783. can add vertices and edges and get an automated updating?
  784.  
  785. [Last modified: March 93]
  786.  
  787. Answer: The XUG FAQ in comp.windows.x includes information on graph display
  788. widgets.  There is also an implementation in the Asente/Swick book.
  789.  
  790.   From Martin Janzen: "You could have a look at DataViews, from V.I.
  791.    Corporation.  This package is used mainly to display a variety of graph
  792.    drawings (eg. bar, line, pie, high/low, and other charts), and to update
  793.    the graphs as information is received from "data sources" such as files,
  794.    processes (through pipes), or devices.
  795.  
  796.    However, it also provides "node" and "edge" objects which can be used
  797.    when working with network graphs.  The DV-Tools function library
  798.    provides routines which traverse a graph, count visits to each node or
  799.    edge, mark nodes or edges of interest, and so on.  A node or edge object
  800.    can have an associated "geometry object" (such as a symbol or a line),
  801.    which represents that node or edge.
  802.  
  803.    Drawbacks: There's no automatic positioning algorithm; when you add a
  804.    node or edge, you have to create and position its geometry object
  805.    yourself.  Also, this isn't a set of add-on widgets; you can either have
  806.    DataViews create an X window (ie. a separate shell), or you can create
  807.    your own XmDrawingArea and use DataViews to update its window when
  808.    expose events are received.  Finally, the package is quite expensive,
  809.    and there is a run-time charge.
  810.  
  811.    The vendor's address is:
  812.      V.I. Corporation,
  813.      47 Pleasant Street,
  814.      Northampton, MA  01060,
  815.             Email: vi@vicorp.com, Phone: (413) 586-4144, Fax:   (413) 584-2649
  816.  
  817.    or
  818.  
  819.      V.I. Corporation (Europe) Ltd.,
  820.      First Base, Beacontree Plaza,
  821.      Gillette Way,                      Email: viesales@eurovi.uucp
  822.      Reading, Berkshire  RG2 0BP"
  823.    Phone: +44 734 756010,      Fax:   +44 734 756104
  824.  
  825. From Craig Timmerman: Just wanted others to know that there is a third
  826. competitor in what may be come a big market for generic APIs.  The product is
  827. called Open Interface and Neuron Data is the vendor.  Neuron has added some
  828. extra, more complex widgets to their set.  The two most notable are a table
  829. and network widget.  [...] I believe that the network widget got its name from
  830. its ability to display expert system networks that Neuron's AI tools needed.
  831. It would be more aptly named the graph widget.  It can display and manipulate
  832. graphs of various types (trees, directed graphs, etc).  Contact is
  833.  
  834.         Neuron Data
  835.         156 University Avenue
  836.         Palo Alto,  CA  94301
  837.         (415) 321-4488
  838.  
  839.  
  840. prism!gt3273b@gatech.edu  (RENALDS,ANDREW THEODORE) posted a set of public
  841. domain routines for graph drawing.  Contact him for a later set.
  842.  
  843. From Ramon Santiago (santiago@fgssu1.fgs.slb.com): HP has released source code
  844. for XmGraph and XmArc, part of the InterWorks library, which does exactly
  845. this. The sources can be obtained by contacting Dave Shaw,
  846. librarian@iworks.ecn.uiowa.edu. A few trivial source code changes need to be
  847. made to get these widgets to compile under Motif 1.2.
  848.  
  849. Free DAG - directed acyclic graph drawing software in motif environment is
  850. available. Please send a note to address below if you want it:
  851.  
  852. Budak Arpinar, TUBITAK Software Research & Development Center, Ankara,
  853. TURKIYE, E-mail : C51881@TRMETU.BITNET
  854.  
  855.  
  856.  
  857. -----------------------------------------------------------------------------
  858. Subject: 156)  Is there a help system available, such as in Windows 3?  Or any
  859. Motif based hypertext system.
  860.  
  861. [Last modified: May 93]
  862.  
  863. Answer:
  864.  
  865. Bristol Technology have a hypertext system HyperHelp with the look-and-feel of
  866. either Motif or OpenLook. It should be available from january 31, 1992.
  867. Contact
  868.  
  869.         Bristol Technology Inc.
  870.         898 Ethan Allen Highway
  871.         Ridgefield, CT  06877
  872.         203-438-6969 (phone)
  873.         203-438-5013 (fax)
  874.         uunet.uu.net!bristol!keith
  875.  
  876. Demos are available by anonymous ftp from  ftp.uu.net (137.39.1.9) in the
  877. vendor/Bristol/HyperHelp as files sun.motif.tar.Z and hp.tar.Z.
  878.  
  879. There was a posting of a motif hypertext-widget to comp.sources.x (Author:
  880. B.Raoult ( mab@ecmwf.co.uk ) ).  It had the facility to read in helptext from
  881. a file.
  882.  
  883. From Francois Felix Ingrand (felix@idefix.laas.fr): I have translated the Info
  884. AW (originally written by Jordan Hubbard) to Motif. It is a Widget to browse
  885. Info files (format used by GNU for their various documentations). I use it as
  886. the help system of various tool I wrote.  It is available on laas.laas.fr
  887. (140.93.0.15) in /pub/prs/xinfo-motif.tar.Z
  888.  
  889. Form Scott Raney (raney@metacard.com) MetaCard is a commercial package that
  890. can be used to implement hypertext help.  The text fields support multiple
  891. typefaces, sizes, styles, colors, subscript/superscript, and hypertext links.
  892. It has a Motif interface, and a template for calling it from an Xt/Motif
  893. application is included.  You can FTP a save-disabled distribution from
  894. ftp.metacard.com or from world.std.com.  For more info, email to
  895. info@metacard.com.
  896.  
  897.  
  898. The Motifation GbR also provides a hypertext-helpsystem named 'XpgHelp'.
  899. (Motif look-and-feel / features like those known from MS Windows Help ) For a
  900. free demo or more information send email either to griebel@uni-paderborn.d e
  901. or contact the distributor:
  902.  
  903.         PEM GmbH,
  904.         Vaihinger Strasse 49,
  905.         7000 Stuttgart 80,
  906.         Germany,
  907.         +49 (0) 711 713045 (phone),
  908.         +49 (0) 711 713047 (fax),
  909.         email: basien@pem-stuttgart.de
  910.  
  911. XpgHelp has nearly the same features like HyperHelp: (multiple fonts, graphics
  912. in b&w and color, different styles, tabs, links, short links, notepad, ...)
  913.  
  914. The Interface Builder MOTIFATION uses XpgHelp as its hypertext helpsystem.
  915.  
  916.  
  917.  
  918. -----------------------------------------------------------------------------
  919. Subject: 157)  Can I specify a widget in a resource file?
  920.  
  921. Answer: This answer, which uses the Xmu library, is due to David Elliott.  If
  922. the converter is added, then the name of a widget (a string) can be used in
  923. resource files, and will be converted to the appropriate widget.
  924.  
  925. This code, which was basically stolen from the Athena Form widget, adds a
  926. String to Widget converter.  I wrote it as a general routine that I call at
  927. the beginning of all of my programs, and made it so I could add other
  928. converters as needed (like String to Unit Type ;-).
  929.  
  930.         #include <X11/Intrinsic.h>
  931.         #include <X11/StringDefs.h>
  932.         #include <Xm/Xm.h>
  933.         #include <X11/Xmu/Converters.h>
  934.         #include <X11/IntrinsicP.h>
  935.         #include <X11/CoreP.h>
  936.  
  937.         void
  938.         setupConverters()
  939.         {
  940.                 static XtConvertArgRec parentCvtArgs[] = {
  941.                         {XtBaseOffset, (caddr_t)XtOffset(Widget, core.parent),
  942.                                 sizeof(Widget)}
  943.                 };
  944.  
  945.                 XtAddConverter(XmRString, XmRWindow, XmuCvtStringToWidget,
  946.                         parentCvtArgs, XtNumber(parentCvtArgs));
  947.         }
  948.  
  949.  
  950.  
  951. -----------------------------------------------------------------------------
  952. Subject: 158)  Why are only some of my translations are being installed?  I
  953. have a translation table like the following, but only the first ones are
  954. getting installed and the rest are ignored.
  955.  
  956.  *Text.translations:    #override \
  957.      Ctrl<Key>a:    beginning-of-line() \n\
  958.      Ctrl<Key>e:    end-of-line() \n\
  959.      Ctrl<Key>f:    forward-character() \n\
  960.  
  961.  
  962. Answer: Most likely, you have a space at the end of one of the lines (the
  963. first in this case).
  964.  
  965.      Ctrl<Key>a:    beginning-of-line() \n\
  966.                                            ^ space here
  967.  
  968. The second backslash in each line is there to protect the real newline
  969. character and so you must not follow it with anything other than the newline
  970. itself. Otherwise it acts as the end of the resource definition and the
  971. remaining lines are not added.
  972.  
  973.  
  974. -----------------------------------------------------------------------------
  975. Subject: 159)  Where can I get the PanHandler code?
  976.  
  977. Answer: It is available by email from Chuck Ocheret:  chuck@IMSI.COM.
  978.  
  979. -----------------------------------------------------------------------------
  980. Subject: 160)  What are these passive grab warnings?  When I destroy certain
  981. widgets I get a stream of messages
  982.  
  983.     Warning: Attempt to remove non-existant passive grab
  984.  
  985.  
  986. Answer: They are meaningless, and you want to ignore them.  Do this (from Kee
  987. Hinckley) by installing an XtWarning handler that explicitly looks for them
  988. and discards them:
  989.  
  990.         static void xtWarnCB(String message) {
  991.            if (asi_strstr(message, "non-existant passive grab", TRUE)) return;
  992.            ...
  993.  
  994. They come from Xt, and (W. Scott Meeks): "it's something that the designers of
  995. Xt decided the toolkit should do. Unfortunately, Motif winds up putting
  996. passive grabs all over the place for the menu system.  On the one hand, we
  997. want to remove all these grabs when menus get destroyed so that they don't
  998. leak memory; on the other hand, it's almost impossible to keep track of all
  999. the grabs, so we have a conservative strategy of ungrabbing any place where a
  1000. grab could have been made and we don't explicitly know that there is no grab.
  1001. The unfortunate side effect is the little passive grab warning messages.
  1002. We're trying to clean these up where possible, but there are some new places
  1003. where the warning is generated.  Until we get this completely cleaned up (1.2
  1004. maybe), your best bet is probably to use a warning handler."
  1005.  
  1006. -----------------------------------------------------------------------------
  1007. Subject: 161)  How do I have more buttons than three in a box?  I want to have
  1008. something like a MessageBox (or other widget) with more than three buttons,
  1009. but with the same nice appearance.
  1010.  
  1011. [Last modified: May 93]
  1012.  
  1013. Answer: The Motif 1.2 MessageBox widget allows extra buttons to be added after
  1014. the OK button. Just create the extra buttons as children of the MessageBox.
  1015. Similarly with the SelectionBox.
  1016.  
  1017. Pre-Motif 1.2, you have to do one of the following methods.
  1018.  
  1019. A SelectionBox is created with four buttons, but the fourth (the Apply button)
  1020. is unmanaged. To manage it get its widget ID via
  1021. XmSelectionBoxGetChild(parent, XmDIALOG_APPLY_BUTTON) and then XtManage it.
  1022. Unmanage all of the other bits in the SelectionBox that you don't want.  If
  1023. you want more than four buttons, try two SelectionBoxes (or similar) together
  1024. in a container, where all of the unwanted parts of the widgets are unmanaged.
  1025.  
  1026. Alternatively, build your own dialog:
  1027.  
  1028. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  1029.  * This program is freely distributable without licensing fees and
  1030.  * is provided without guarantee or warranty expressed or implied.
  1031.  * This program is -not- in the public domain.  This program is
  1032.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  1033.  */
  1034.  
  1035. /* action_area.c -- demonstrate how CreateActionArea() can be used
  1036.  * in a real application.  Create what would otherwise be identified
  1037.  * as a PromptDialog, only this is of our own creation.  As such,
  1038.  * we provide a TextField widget for input.  When the user presses
  1039.  * Return, the Ok button is activated.
  1040.  */
  1041. #include <Xm/DialogS.h>
  1042. #include <Xm/PushBG.h>
  1043. #include <Xm/PushB.h>
  1044. #include <Xm/LabelG.h>
  1045. #include <Xm/PanedW.h>
  1046. #include <Xm/Form.h>
  1047. #include <Xm/RowColumn.h>
  1048. #include <Xm/TextF.h>
  1049.  
  1050. typedef struct {
  1051.     char *label;
  1052.     void (*callback)();
  1053.     caddr_t data;
  1054. } ActionAreaItem;
  1055.  
  1056. static void
  1057.     do_dialog(), close_dialog(), activate_cb(),
  1058.     ok_pushed(), cancel_pushed(), help();
  1059.  
  1060. main(argc, argv)
  1061. int argc;
  1062. char *argv[];
  1063. {
  1064.     Widget toplevel, button;
  1065.     XtAppContext app;
  1066.  
  1067.     toplevel = XtVaAppInitialize(&app, "Demos",
  1068.         NULL, 0, &argc, argv, NULL, NULL);
  1069.  
  1070.     button = XtVaCreateManagedWidget("Push Me",
  1071.         xmPushButtonWidgetClass, toplevel, NULL);
  1072.     XtAddCallback(button, XmNactivateCallback, do_dialog, NULL);
  1073.  
  1074.     XtRealizeWidget(toplevel);
  1075.     XtAppMainLoop(app);
  1076. }
  1077.  
  1078. /* callback routine for "Push Me" button.  Actually, this represents
  1079.  * a function that could be invoked by any arbitrary callback.  Here,
  1080.  * we demonstrate how one can build a standard customized dialog box.
  1081.  * The control area is created here and the action area is created in
  1082.  * a separate, generic routine: CreateActionArea().
  1083.  */
  1084. static void
  1085. do_dialog(w, file)
  1086. Widget w; /* will act as dialog's parent */
  1087. char *file;
  1088. {
  1089.     Widget dialog, pane, rc, label, text_w, action_a;
  1090.     XmString string;
  1091.     extern Widget CreateActionArea();
  1092.     Arg args[10];
  1093.     static ActionAreaItem action_items[] = {
  1094.         { "Ok",     ok_pushed,     NULL          },
  1095.         { "Cancel", cancel_pushed, NULL          },
  1096.         { "Close",  close_dialog,  NULL          },
  1097.         { "Help",   help,          "Help Button" },
  1098.     };
  1099.  
  1100.     /* The DialogShell is the Shell for this dialog.  Set it up so
  1101.      * that the "Close" button in the window manager's system menu
  1102.      * destroys the shell (it only unmaps it by default).
  1103.      */
  1104.     dialog = XtVaCreatePopupShell("dialog",
  1105.         xmDialogShellWidgetClass, XtParent(w),
  1106.         XmNtitle,  "Dialog Shell",     /* give arbitrary title in wm */
  1107.         XmNdeleteResponse, XmDESTROY,  /* system menu "Close" action */
  1108.         NULL);
  1109.  
  1110.     /* now that the dialog is created, set the Close button's
  1111.      * client data, so close_dialog() will know what to destroy.
  1112.      */
  1113.     action_items[2].data = (caddr_t)dialog;
  1114.  
  1115.     /* Create the paned window as a child of the dialog.  This will
  1116.      * contain the control area (a Form widget) and the action area
  1117.      * (created by CreateActionArea() using the action_items above).
  1118.      */
  1119.     pane = XtVaCreateWidget("pane", xmPanedWindowWidgetClass, dialog,
  1120.         XmNsashWidth,  1,
  1121.         XmNsashHeight, 1,
  1122.         NULL);
  1123.  
  1124.     /* create the control area (Form) which contains a
  1125.      * Label gadget and a List widget.
  1126.      */
  1127.     rc = XtVaCreateWidget("control_area", xmRowColumnWidgetClass, pane, NULL);
  1128.     string = XmStringCreateSimple("Type Something:");
  1129.     XtVaCreateManagedWidget("label", xmLabelGadgetClass, rc,
  1130.         XmNlabelString,    string,
  1131.         XmNleftAttachment, XmATTACH_FORM,
  1132.         XmNtopAttachment,  XmATTACH_FORM,
  1133.         NULL);
  1134.     XmStringFree(string);
  1135.  
  1136.     text_w = XtVaCreateManagedWidget("text-field",
  1137.         xmTextFieldWidgetClass, rc, NULL);
  1138.  
  1139.     /* RowColumn is full -- now manage */
  1140.     XtManageChild(rc);
  1141.  
  1142.     /* Set the client data "Ok" and "Cancel" button's callbacks. */
  1143.     action_items[0].data = (caddr_t)text_w;
  1144.     action_items[1].data = (caddr_t)text_w;
  1145.  
  1146.     /* Create the action area -- we don't need the widget it returns. */
  1147.     action_a = CreateActionArea(pane, action_items, XtNumber(action_items));
  1148.  
  1149.     /* callback for Return in TextField.  Use action_a as client data */
  1150.     XtAddCallback(text_w, XmNactivateCallback, activate_cb, action_a);
  1151.  
  1152.     XtManageChild(pane);
  1153.     XtPopup(dialog, XtGrabNone);
  1154. }
  1155.  
  1156. /*--------------*/
  1157. /* The next four functions are the callback routines for the buttons
  1158.  * in the action area for the dialog created above.  Again, they are
  1159.  * simple examples, yet they demonstrate the fundamental design approach.
  1160.  */
  1161. static void
  1162. close_dialog(w, shell)
  1163. Widget w, shell;
  1164. {
  1165.     XtDestroyWidget(shell);
  1166. }
  1167.  
  1168. /* The "ok" button was pushed or the user pressed Return */
  1169. static void
  1170. ok_pushed(w, text_w, cbs)
  1171. Widget w, text_w;         /* the text widget is the client data */
  1172. XmAnyCallbackStruct *cbs;
  1173. {
  1174.     char *text = XmTextFieldGetString(text_w);
  1175.  
  1176.     printf("String = %s0, text);
  1177.     XtFree(text);
  1178. }
  1179.  
  1180. static void
  1181. cancel_pushed(w, text_w, cbs)
  1182. Widget w, text_w;         /* the text field is the client data */
  1183. XmAnyCallbackStruct *cbs;
  1184. {
  1185.     /* cancel the whole operation; reset to NULL. */
  1186.     XmTextFieldSetString(text_w, "");
  1187. }
  1188.  
  1189. static void
  1190. help(w, string)
  1191. Widget w;
  1192. String string;
  1193. {
  1194.     puts(string);
  1195. }
  1196. /*--------------*/
  1197.  
  1198. /* When Return is pressed in TextField widget, respond by getting
  1199.  * the designated "default button" in the action area and activate
  1200.  * it as if the user had selected it.
  1201.  */
  1202. static void
  1203. activate_cb(text_w, client_data, cbs)
  1204. Widget text_w;              /* user pressed Return in this widget */
  1205. XtPointer client_data;        /* action_area passed as client data */
  1206. XmAnyCallbackStruct *cbs;   /* borrow the "event" field from this */
  1207. {
  1208.     Widget dflt, action_area = (Widget)client_data;
  1209.  
  1210.     XtVaGetValues(action_area, XmNdefaultButton, &dflt, NULL);
  1211.     if (dflt) /* sanity check -- this better work */
  1212.         /* make the default button think it got pushed.  This causes
  1213.          * "ok_pushed" to be called, but XtCallActionProc() causes
  1214.          * the button appear to be activated as if the user selected it.
  1215.          */
  1216.         XtCallActionProc(dflt, "ArmAndActivate", cbs->event, NULL, 0);
  1217. }
  1218.  
  1219. #define TIGHTNESS 20
  1220.  
  1221. Widget
  1222. CreateActionArea(parent, actions, num_actions)
  1223. Widget parent;
  1224. ActionAreaItem *actions;
  1225. int num_actions;
  1226. {
  1227.     Widget action_area, widget;
  1228.     int i;
  1229.  
  1230.     action_area = XtVaCreateWidget("action_area", xmFormWidgetClass, parent,
  1231.         XmNfractionBase, TIGHTNESS*num_actions - 1,
  1232.         XmNleftOffset,   10,
  1233.         XmNrightOffset,  10,
  1234.         NULL);
  1235.  
  1236.     for (i = 0; i < num_actions; i++) {
  1237.         widget = XtVaCreateManagedWidget(actions[i].label,
  1238.             xmPushButtonWidgetClass, action_area,
  1239.             XmNleftAttachment,       i? XmATTACH_POSITION : XmATTACH_FORM,
  1240.             XmNleftPosition,         TIGHTNESS*i,
  1241.             XmNtopAttachment,        XmATTACH_FORM,
  1242.             XmNbottomAttachment,     XmATTACH_FORM,
  1243.             XmNrightAttachment,
  1244.                     i != num_actions-1? XmATTACH_POSITION : XmATTACH_FORM,
  1245.             XmNrightPosition,        TIGHTNESS*i + (TIGHTNESS-1),
  1246.             XmNshowAsDefault,        i == 0,
  1247.             XmNdefaultButtonShadowThickness, 1,
  1248.             NULL);
  1249.         if (actions[i].callback)
  1250.             XtAddCallback(widget, XmNactivateCallback,
  1251.                 actions[i].callback, actions[i].data);
  1252.         if (i == 0) {
  1253.             /* Set the action_area's default button to the first widget
  1254.              * created (or, make the index a parameter to the function
  1255.              * or have it be part of the data structure). Also, set the
  1256.              * pane window constraint for max and min heights so this
  1257.              * particular pane in the PanedWindow is not resizable.
  1258.              */
  1259.             Dimension height, h;
  1260.             XtVaGetValues(action_area, XmNmarginHeight, &h, NULL);
  1261.             XtVaGetValues(widget, XmNheight, &height, NULL);
  1262.             height += 2 * h;
  1263.             XtVaSetValues(action_area,
  1264.                 XmNdefaultButton, widget,
  1265.                 XmNpaneMaximum,   height,
  1266.                 XmNpaneMinimum,   height,
  1267.                 NULL);
  1268.         }
  1269.     }
  1270.  
  1271.     XtManageChild(action_area);
  1272.  
  1273.     return action_area;
  1274. }
  1275.  
  1276.  
  1277.  
  1278. -----------------------------------------------------------------------------
  1279. Subject: 162)  How do I create a "busy working cursor"?
  1280.  
  1281. Answer: - in Baudouin's code (following), the idea is to keep in an array an
  1282. up-to-date list of all shells used in the application, and set for all of them
  1283. the cursor to a watch or to the default cursor, with the 2 functions provided.
  1284.  
  1285. - in Dan Heller's code (later), the idea is to turn on the watch cursor for
  1286. the top-level shell only, popup a working window to possibly abort the
  1287. callback, and manage some expose events during the callback.
  1288.  
  1289. - in the FAQ for comp.windows.x (#113), the idea is to bring a large window on
  1290. top of the application, hide all windows below it, and turn on the watch
  1291. cursor on this large window. Unmapping the large window resets the default
  1292. cursor, mapping it turns on the watch cursor.
  1293.  
  1294. From Baudouin Raoult (mab@ecmwf.co.uk)
  1295.  
  1296. void my_SetWatchCursor(w)
  1297. Widget w;
  1298. {
  1299.         static Cursor watch = NULL;
  1300.  
  1301.         if(!watch)
  1302.                 watch = XCreateFontCursor(XtDisplay(w),XC_watch);
  1303.  
  1304.         XDefineCursor(XtDisplay(w),XtWindow(w),watch);
  1305.         XmUpdateDisplay(w);
  1306. }
  1307.  
  1308. void my_ResetCursor(w)
  1309. Widget w;
  1310. {
  1311.         XUndefineCursor(XtDisplay(w),XtWindow(w));
  1312.         XmUpdateDisplay(w);
  1313. }
  1314.  
  1315.  
  1316. Answer: A solution with lots of bells and whistles is
  1317.  
  1318. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  1319.  * This program is freely distributable without licensing fees and
  1320.  * is provided without guarantee or warrantee expressed or implied.
  1321.  * This program is -not- in the public domain.
  1322.  */
  1323.  
  1324. /* busy.c -- demonstrate how to use a WorkingDialog and to process
  1325.  * only "important" events.  e.g., those that may interrupt the
  1326.  * task or to repaint widgets for exposure.  Set up a simple shell
  1327.  * and a widget that, when pressed, immediately goes into its own
  1328.  * loop.  First, "lock" the shell so that a timeout cursor is set on
  1329.  * the shell and pop up a WorkingDialog.  Then enter loop ... sleep
  1330.  * for one second ten times, checking between each interval to see
  1331.  * if the user clicked the Stop button or if any widgets need to be
  1332.  * refreshed.  Ignore all other events.
  1333.  *
  1334.  * main() and get_busy() are stubs that would be replaced by a real
  1335.  * application; all other functions can be used "as is."
  1336.  */
  1337. #include <Xm/MessageB.h>
  1338. #include <Xm/PushB.h>
  1339. #include <X11/cursorfont.h>
  1340.  
  1341. Widget shell;
  1342. void TimeoutCursors();
  1343. Boolean CheckForInterrupt();
  1344.  
  1345. main(argc, argv)
  1346. int argc;
  1347. char *argv[];
  1348. {
  1349.     XtAppContext app;
  1350.     Widget button;
  1351.     XmString label;
  1352.     void get_busy();
  1353.  
  1354.     shell = XtVaAppInitialize(&app, "Demos",
  1355.         NULL, 0, &argc, argv, NULL, NULL);
  1356.  
  1357.     label = XmStringCreateSimple(
  1358.         "Boy, is *this* going to take a long time.");
  1359.     button = XtVaCreateManagedWidget("button",
  1360.         xmPushButtonWidgetClass, shell,
  1361.         XmNlabelString,          label,
  1362.         NULL);
  1363.     XmStringFree(label);
  1364.     XtAddCallback(button, XmNactivateCallback, get_busy, argv[1]);
  1365.  
  1366.     XtRealizeWidget(shell);
  1367.     XtAppMainLoop(app);
  1368. }
  1369.  
  1370. void
  1371. get_busy(widget)
  1372. Widget widget;
  1373. {
  1374.     int n;
  1375.  
  1376.     TimeoutCursors(True, True);
  1377.     for (n = 0; n < 10; n++) {
  1378.         sleep(1);
  1379.         if (CheckForInterrupt()) {
  1380.             puts("Interrupt!");
  1381.             break;
  1382.         }
  1383.     }
  1384.     if (n == 10)
  1385.         puts("done.");
  1386.     TimeoutCursors(False, NULL);
  1387. }
  1388.  
  1389. /* The interesting part of the program -- extract and use at will */
  1390. static Boolean stopped;  /* True when user wants to stop processing */
  1391. static Widget dialog;    /* WorkingDialog displayed when timed out */
  1392.  
  1393. /* timeout_cursors() turns on the "watch" cursor over the application
  1394.  * to provide feedback for the user that he's going to be waiting
  1395.  * a while before he can interact with the appliation again.
  1396.  */
  1397. void
  1398. TimeoutCursors(on, interruptable)
  1399. int on, interruptable;
  1400. {
  1401.     static int locked;
  1402.     static Cursor cursor;
  1403.     extern Widget shell;
  1404.     XSetWindowAttributes attrs;
  1405.     Display *dpy = XtDisplay(shell);
  1406.     XEvent event;
  1407.     Arg args[1];
  1408.     XmString str;
  1409.     extern void stop();
  1410.  
  1411.     /* "locked" keeps track if we've already called the function.
  1412.      * This allows recursion and is necessary for most situations.
  1413.      */
  1414.     on? locked++ : locked--;
  1415.     if (locked > 1 || locked == 1 && on == 0)
  1416.         return; /* already locked and we're not unlocking */
  1417.  
  1418.     stopped = False; /* doesn't matter at this point; initialize */
  1419.     if (!cursor) /* make sure the timeout cursor is initialized */
  1420.         cursor = XCreateFontCursor(dpy, XC_watch);
  1421.  
  1422.     /* if "on" is true, then turn on watch cursor, otherwise, return
  1423.      * the shell's cursor to normal.
  1424.      */
  1425.     attrs.cursor = on? cursor : None;
  1426.  
  1427.     /* change the main application shell's cursor to be the timeout
  1428.      * cursor (or to reset it to normal).  If other shells exist in
  1429.      * this application, they will have to be listed here in order
  1430.      * for them to have timeout cursors too.
  1431.      */
  1432.     XChangeWindowAttributes(dpy, XtWindow(shell), CWCursor, &attrs);
  1433.  
  1434.     XFlush(dpy);
  1435.  
  1436.     if (on) {
  1437.         /* we're timing out, put up a WorkingDialog.  If the process
  1438.          * is interruptable, allow a "Stop" button.  Otherwise, remove
  1439.          * all actions so the user can't stop the processing.
  1440.          */
  1441.         str = XmStringCreateSimple("Busy.  Please Wait.");
  1442.         XtSetArg(args[0], XmNmessageString, str);
  1443.         dialog = XmCreateWorkingDialog(shell, "Busy", args, 1);
  1444.         XmStringFree(str);
  1445.         XtUnmanageChild(
  1446.             XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON));
  1447.         if (interruptable) {
  1448.             str = XmStringCreateSimple("Stop");
  1449.             XtVaSetValues(dialog, XmNcancelLabelString, str, NULL);
  1450.             XmStringFree(str);
  1451.             XtAddCallback(dialog, XmNcancelCallback, stop, NULL);
  1452.         } else
  1453.             XtUnmanageChild(
  1454.                 XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
  1455.         XtUnmanageChild(
  1456.             XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
  1457.         XtManageChild(dialog);
  1458.     } else {
  1459.         /* get rid of all button and keyboard events that occured
  1460.          * during the time out.  The user shouldn't have done anything
  1461.          * during this time, so flush for button and keypress events.
  1462.          * KeyRelease events are not discarded because accelerators
  1463.          * require the corresponding release event before normal input
  1464.          * can continue.
  1465.          */
  1466.         while (XCheckMaskEvent(dpy,
  1467.                 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
  1468.                 | PointerMotionMask | KeyPressMask, &event)) {
  1469.             /* do nothing */;
  1470.         }
  1471.         XtDestroyWidget(dialog);
  1472.     }
  1473. }
  1474.  
  1475. /* User Pressed the "Stop" button in dialog. */
  1476. void
  1477. stop(dialog)
  1478. Widget dialog;
  1479. {
  1480.     stopped = True;
  1481. }
  1482.  
  1483. Boolean
  1484. CheckForInterrupt()
  1485. {
  1486.     extern Widget shell;
  1487.     Display *dpy = XtDisplay(shell);
  1488.     Window win = XtWindow(dialog);
  1489.     XEvent event;
  1490.  
  1491.     /* Make sure all our requests get to the server */
  1492.     XFlush(dpy);
  1493.  
  1494.     /* Let motif process all pending exposure events for us. */
  1495.     XmUpdateDisplay(shell);
  1496.  
  1497.     /* Check the event loop for events in the dialog ("Stop"?) */
  1498.     while (XCheckMaskEvent(dpy,
  1499.             ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
  1500.             PointerMotionMask | KeyPressMask | KeyReleaseMask,
  1501.             &event)) {
  1502.         /* got an "interesting" event. */
  1503.         if (event.xany.window == win)
  1504.             XtDispatchEvent(&event); /* it's in our dialog.. */
  1505.         else /* uninteresting event--throw it away and sound bell */
  1506.             XBell(dpy, 50);
  1507.     }
  1508.     return stopped;
  1509. }
  1510.  
  1511.  
  1512. -----------------------------------------------------------------------------
  1513. Subject: 163)  Can I use the hourglass that mwm uses?
  1514.  
  1515. [Last modified: March 93]
  1516.  
  1517. Answer: The hourglass used by mwm is hard-coded into code that is subject to
  1518. OSF copyright. In Motif 1.2 though, the bitmaps for this and other things
  1519. (information, no_enter, question, warning, working) were made available.  The
  1520. install process will probably add them to /usr/include/X11/bitmaps.
  1521. Otherwise, just use the watch cursor XC_watch of the previous question,
  1522. because that has the same semantics.
  1523.  
  1524.  
  1525.  
  1526. -----------------------------------------------------------------------------
  1527. Subject: 164)  What order should the libraries be linked in?
  1528.  
  1529. [Last modified: August 92]
  1530.  
  1531. Answer: At link time, use the library order  -lXm -lXt -lX11. There are two
  1532. reasons for this (dbrooks@osf.org):
  1533.  
  1534. On most systems, the order matters because the linker won't re-scan a library
  1535. once it is done with it.  Thus any references to Xlib calls from Xm will
  1536. probably be unresolved.
  1537.  
  1538. The [other] problem is that there are two VendorShell widgets. A dummy is
  1539. provided in the Xt library, but a widget set will rely on its own being
  1540. referenced.  If you mention Xt first, the linker will choose the wrong one.
  1541.  
  1542. Motif code will wrongly assume the Motif VendorShell has been class-
  1543. initialized [and will probably crash].
  1544.  Xaw has a similar problem, but a softer landing; it only complains about
  1545. unregistered converters.
  1546.  
  1547.  
  1548. -----------------------------------------------------------------------------
  1549. Subject: 165)  How do I use xmkmf for Motif clients?
  1550.  
  1551. [Last modified: October 1992]
  1552.  
  1553. Answer: This advice comes from dbrooks@osf.org:
  1554.  
  1555. There are a number of intractable problems with using X configuration files
  1556. and xmkmf, while trying to make it easy to build Motif.  Not the least of
  1557. these, but one I've never heard mentioned yet, is that the rules for
  1558. contructing the names of shared library macros are machine-dependent, and in
  1559. the various xxxLib.tmpl files.  Do we edit all those files to add definitions
  1560. for XMLIB, DEPXMLIB, etc., or do we put a maze of #ifdefs into the Motif.tmpl
  1561. file?
  1562.  
  1563. Please note that, if you install Motif, it overwrites your installed
  1564. Imake.tmpl with one that includes Motif.tmpl and Motif.rules.
  1565.  
  1566. With those caveats, I think the following guidelines will help.
  1567.  
  1568. David Brooks OSF
  1569.  
  1570. Clients in the X11R5 release use the xmkmf command to build Makefiles.  In
  1571. general, the xmkmf command cannot be used for Motif clients, because of the
  1572. need to consider the UseInstalledMotif flag separately.  Since xmkmf is a
  1573. simple script that calls imake, it is easy to construct the proper call to
  1574. imake using the following rules.
  1575.  
  1576. In the following, replace {MTOP} by the toplevel directory with the Motif
  1577. source tree, and {XTOP} by the toplevel ("mit") directory with the X source.
  1578. It is assumed that the directory containing your installed imake is in your
  1579. PATH.
  1580.  
  1581. When needed, the imake variables XTop and MTop are normally set in your
  1582. site.def (to {XTOP} amd {MTOP} respectively); however they may also be set
  1583. with additional -D arguments to imake.
  1584.  
  1585. 1. With both X and Motif in their source trees, ensure the imake variables
  1586.    XTop and MTop are set, and use:
  1587.  
  1588.         ${XTOP}/config/imake -I{MTOP}/config
  1589.  
  1590. 2. With Motif in its source tree, and X installed, ensure MTop is set, and
  1591.    use:
  1592.  
  1593.         imake -I{MTOP}/config -DUseInstalled
  1594.  
  1595. 3. With both Motif and X installed, and a nonstandard ProjectRoot (see
  1596.    site.def for an explanation of this), use:
  1597.  
  1598.         imake -DUseInstalled -DUseInstalledMotif -I{ProjectRoot}/lib/X11/config
  1599.  
  1600.    or, if the configuration files are in /usr/lib/X11/config:
  1601.  
  1602.         imake -DUseInstalled -DUseInstalledMotif
  1603.  
  1604.  
  1605. To build a simple Imakefile, remember to include lines like this:
  1606.  
  1607.         LOCAL_LIBRARIES = XmClientLibs
  1608.                 DEPLIBS = XmClientDepLibs
  1609.  
  1610. Or, for a client that uses uil/mrm, replace these by MrmClientLibs and
  1611. MrmClientDepLibs, and also use:
  1612.  
  1613.         MSimpleUilTarget(program)
  1614.  
  1615. to build the client and uid file.  Look at the demos for more examples.
  1616.  
  1617.  
  1618. And Paul Howell <grue@engin.umich.edu> added:
  1619.  
  1620. i did this, calling the new script "xmmkmf".  It passes both -DUseInstalled
  1621. and -DUseInstalledMotif.
  1622.  
  1623. and i modified the stock R5 Imake.tmpl to do this:
  1624.  
  1625. #include <Project.tmpl>
  1626. #ifdef UseInstalledMotif
  1627. #include <Motif.tmpl>
  1628. #endif
  1629.  
  1630. #include <Imake.rules>
  1631. #ifdef UseInstalledMotif
  1632. #include <Motif.rules>
  1633. #endif
  1634.  
  1635. the result was something that does both athena and motif rules.  and it really
  1636. works, just that easy!
  1637.  
  1638.  
  1639. -----------------------------------------------------------------------------
  1640. Subject: 166)  How do I make context sensitive help?  The Motif Style Guide
  1641. says that an application must initiate context-sensitive help by changing the
  1642. shape of the pointer to the question pointer. When the user moves the pointer
  1643. to the component help is wanted on and presses BSelect, any available context
  1644. sensitive help for the component must be presented, and the pointer reverts
  1645. from the question pointer.
  1646. [Last modified: August 92]
  1647.  
  1648. Answer: A widget that gives context sensitive help would place this help in
  1649. the XmNhelpCallback function. To trigger this function: (from Martin G C
  1650. Davies, mgcd@se.alcbel.be)
  1651.  
  1652. I use the following callback that is called when the "On Context" help
  1653. pulldown menu is selected. It does the arrow bit and calls the help callbacks
  1654. for the widget. It also zips up the widget tree looking for help if needs be.
  1655. I don't restrict the arrows motion so I can get help on dialog boxes. No
  1656. prizes for guessing what "popup_message" does.
  1657.  
  1658.  
  1659. static void ContextHelp(
  1660.     Widget              w ,
  1661.     Opaque              * tag ,
  1662.     XmAnyCallbackStruct * callback_struct
  1663. )
  1664. {
  1665.     static Cursor   context_cursor = NULL ;
  1666.     Widget          context_widget ;
  1667.  
  1668.     if ( context_cursor == NULL )
  1669.         context_cursor = XCreateFontCursor( display, XC_question_arrow ) ;
  1670.  
  1671.     context_widget = XmTrackingLocate( top_level_widget,
  1672.                                 context_cursor, FALSE ) ;
  1673.  
  1674.     if ( context_widget != NULL ) /* otherwise its not a widget */
  1675.     {
  1676.         XmAnyCallbackStruct cb ;
  1677.  
  1678.         cb.reason = XmCR_HELP ;
  1679.         cb.event = callback_struct->event ;
  1680.  
  1681.         /*
  1682.          * If there's no help at this widget we'll track back
  1683.            up the hierarchy trying to find some.
  1684.          */
  1685.  
  1686.         do
  1687.         {
  1688.             if ( ( XtHasCallbacks( context_widget, XmNhelpCallback ) ==
  1689.                                                 XtCallbackHasSome ) )
  1690.             {
  1691.                 XtCallCallbacks( context_widget, XmNhelpCallback, & cb ) ;
  1692.                 return ;
  1693.             }
  1694.             else
  1695.                 context_widget = XtParent( context_widget ) ;
  1696.         } while ( context_widget != NULL ) ;
  1697.     }
  1698.  
  1699.     popup_message( "No context-sensitive help found\n\
  1700. for the selected object." ) ;
  1701. }
  1702.  
  1703.  
  1704.  
  1705. Dave Bonnett suggested, to use the following translations for XmText (and
  1706. XmTextField) widgets to get the same help with key strokes, and to provide an
  1707. accelerator label in the Context help menu entry.
  1708.  
  1709. MyApp*XmText*translations: #override\n\
  1710.                                 <Key>F1:    Help()
  1711.  
  1712. MyApp*Help_menu*Contextual Help.acceleratorText:   F1
  1713.  
  1714. MyApp*defaultVirtualBindings:           osfBackSpace : <Key>Delete\n\
  1715.                                         osfRight : <Key>Right\n\
  1716.                                         osfLeft  : <Key>Left\n\
  1717.                                         osfUp    : <Key>Up\n\
  1718.                                         osfHelp  : <Key>F1\n\
  1719.                                         osfDown  : <Key>Down
  1720.  
  1721.  
  1722. -----------------------------------------------------------------------------
  1723. Subject: 167)  How do I debug a modal interaction?
  1724.  
  1725. When an application crashes in a modal section (such as in a modal dialog, a
  1726. menu or when a drag and drop is in action), I cannot access the debugger.
  1727.  
  1728. [Last modified: January 1993]
  1729.  
  1730. Answer: Run the debugger on one display while the application writes to
  1731. another display.
  1732.  
  1733.  
  1734. -----------------------------------------------------------------------------
  1735. Subject: 168)  Where can I get info on the Motif drag and drop protocol?
  1736.  
  1737. [Last modified: March]
  1738.  
  1739. Answer: The drag and drop protocol implemented by OSF is not stable, so they
  1740. have not published it yet. The API should remain stable though.  The OSF
  1741. protocol is not compatable with the OpenLook protocol.  OSF and Sun are
  1742. working on a joint protocol for publication.
  1743.  
  1744. For programming examples on Motif D&D, see the Motif 1.2 Programmers Guide.
  1745.  
  1746. For a third alternative, try Roger Reynolds D&D protocol, available from
  1747. netcom.com in /pub/rogerr.
  1748.  
  1749. -----------------------------------------------------------------------------
  1750. Subject: 169)  TOPIC: ACKNOWLEDGEMENTS
  1751.  
  1752. This list was compiled using questions and answers posed to
  1753. comp.windows.x.motif and motif-talk. Some extracts were also taken from FAQs
  1754. of comp.windows.x.  To all who contributed one way or the other, thanks! I
  1755. haven't often given individual references, but  you may recognise
  1756. contributions. If I have mangled them too much, let me know.
  1757.  
  1758.  
  1759.  
  1760. +----------------------+---+
  1761.   Jan Newmarch, Information Science and Engineering,
  1762.   University of Canberra, PO Box 1, Belconnen, Act 2616
  1763.   Australia. Tel: (Aust) 6-2522422. Fax: (Aust) 6-2522999
  1764.  
  1765.   ACSnet: jan@ise.canberra.edu.au
  1766.   ARPA:   jan%ise.canberra.edu.au@uunet.uu.net
  1767.   UUCP:   {uunet,ukc}!munnari!ise.canberra.edu.au!jan
  1768.   JANET:  jan%au.edu.canberra.ise@EAN-RELAY
  1769.  
  1770.  
  1771. Jan Newmarch of  has been maintaining this FAQ and has really helped a great
  1772. many of us by providing this valuable service.  He deserves a big round of
  1773. applause for his efforts.  I use this resource all the time and it has saved
  1774. me countless hours with manual and source code trying to relearn what others
  1775. have already discovered.  Jan`s efforts are gratefully acknowledged here.
  1776.  
  1777. I am maintaining the FAQ now and will strive to maintain the quality
  1778. that Jan has acheived. Enjoy!
  1779. Brian
  1780.  
  1781. Brian Dealy - X Professional Organization
  1782. dealy@kong.gsfc.nasa.gov
  1783.  
  1784. PO Box 78, Beltsville, MD 20704 USA
  1785.  
  1786. (301) 572-8267
  1787. (410) 799-7197 (FAX)
  1788. +--------------------------+
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914. -- 
  1915. ..........................
  1916.  
  1917.