home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / answers / motif-faq / part4 < prev    next >
Text File  |  1993-10-25  |  61KB  |  1,425 lines

  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 4 of 5)
  5. Followup-To: poster
  6. Date: 25 Oct 1993 16:09:45 -0400
  7. Organization: NASA/Goddard Space Flight Center
  8. Lines: 1404
  9. Sender: dealy@vilya.gsfc.nasa.gov
  10. Approved: news-answers-request@MIT.Edu
  11. Expires: +1 months
  12. Message-ID: <2ahbq9$10n@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/part4
  17. Last-modified: Oct 15 1993
  18. Version: 3.6
  19. Xref: senator-bedfellow.mit.edu news.answers:13925 comp.answers:2410
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. -----------------------------------------------------------------------------
  27. Subject: 95)  TOPIC: XMSTRING
  28.  
  29. -----------------------------------------------------------------------------
  30. Subject: 96)  How can I get the Ascii text out of an XmString?
  31.  
  32. Answer: To get the first line of text from a string created left-to-right
  33.  
  34.  
  35.         char *str;
  36.         XmString xmstr;
  37.  
  38.         /* stuff to create xmstr */
  39.         ...
  40.  
  41.         /* set str to point to the text */
  42.         XmStringGetLtoR(xmstr, XmSTRING_DEFAULT_CHARSET, &str);
  43.         /* use the string */
  44.         ...
  45.  
  46.         /* and reclaim space */
  47.         XtFree(str);
  48.  
  49.  
  50. -----------------------------------------------------------------------------
  51. Subject: 97)  When can XmStrings used as resources be freed?
  52.  
  53. Answer: The policy OSF have been trying to enforce is that if you set an
  54. XmString or XmStringTable resource, the application is responsible for freeing
  55. the XmStrings used because the widget makes a copy.  If you get an XmString
  56. resource, then the application must free the value gotten.  If you get an
  57. XmStringTable, then the application should NOT free the value gotten.  If the
  58. application wants to manipulate it, it should make a copy first. This policy
  59. appears to be implemented progressively, so may be less true for Motif 1.0
  60. than 1.1.
  61.  
  62. -----------------------------------------------------------------------------
  63. Subject: 98)  Why doesn't XmStringGetNextSegment() work properly?
  64.  
  65. Answer: The documentation in Motif 1.0 is in error. Instead of
  66.  
  67.         XmStringGetnextSegment(context, ...)
  68.         XmStringContext * context;
  69.  
  70. it should be
  71.  
  72.         XmStringGetnextSegment(context, ...)
  73.         XmStringContext context;
  74.  
  75. i.e. with no indirection.
  76.  
  77.  
  78. -----------------------------------------------------------------------------
  79. Subject: 99)  Why does using XmStringDraw cause a Bad Font error?
  80.  
  81. [Last modified: May 93]
  82.  
  83. Answer: From Thomas Berlage (berlage@gmdzi.gmd.de): You could call this a bug
  84. in Motif. You pass a GC to XmStringDraw, however, Motif wants to use the fonts
  85. from the font list to draw the string.  Therefore it replaces the font of the
  86. GC temporarily with some fonts of its own as specified in the font list. In
  87. the end it tries to restore the old font of the GC. There comes the problem:
  88.  
  89. If a GC uses the default font, the client side GC structure does not have a
  90. valid font id (that is the 0xffffffff you may see in the error message). Motif
  91. tries to restore this invalid id at the end.
  92.  
  93. The workaround is: Before drawing with XmStringDraw, set the font id of the GC
  94. to any valid font id, for example using
  95.  
  96.       XSetFont (display, gc, XLoadFont (display, "fixed"));
  97.  
  98.  
  99.  
  100.  
  101. -----------------------------------------------------------------------------
  102. Subject: 100)  TOPIC: DIALOGS
  103.  
  104. -----------------------------------------------------------------------------
  105. Subject: 101)  How do I stop my dialog disappearing when I press the help
  106. button?
  107.  
  108. Answer: Bulletin board has the resource autoUnmanage which defaults to True.
  109. This unmanages the widget when any button child is activated - including the
  110. help button.  Set this to False to stop it disappearing. Note that you then
  111. have to unmanage the bulletin board yourself when any other button is
  112. activated.
  113.  
  114. -----------------------------------------------------------------------------
  115. Subject: 102)  How do I make my own dialog?  I want a dialog with my own set
  116. of buttons that stretch and shrink like the ones in e.g. PromptDialog and its
  117. own contents.
  118.  
  119. Answer: Start off with say a PromptDialog. Unmanage the buttons you don't want
  120. or manage the Apply button if you want another. Unmanage the other bits of the
  121. selection box you don't want. You can add another WorkArea child to the
  122. selection box for any extra stuff you want.
  123.  
  124.     /* Copyright 1990, Kee Hinckley and Brian Holt Hawthorne */
  125.     /* Permission granted for any use, provided this copyright */
  126.     /* notice is maintained. */
  127.  
  128.     /* Create a dialog box */
  129.     argcount = setArgs(&args, XmNautoUnmanage, False, NULL);
  130.     SomeDialog = XmCreatePromptDialog(mainShell, "someDialog", args, argcount);
  131.  
  132.     /* Now get rid of the things we don't want */
  133.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_SELECTION_LABEL);
  134.     XtUnmanageChild(child);
  135.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_TEXT);
  136.     XtUnmanageChild(child);
  137.  
  138.     /* set the callbacks, and make sure the buttons we want are there */
  139.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_OK_BUTTON);
  140.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someArg);
  141.     XtAddCallback(child, XmNactivateCallback, unManage, SomeDialog);
  142.     XtManageChild(child);
  143.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_APPLY_BUTTON);
  144.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someOtherArg);
  145.     XtManageChild(child);
  146.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_CANCEL_BUTTON);
  147.     XtAddCallback(child, XmNactivateCallback, dialogUnmanage, SomeDialog);
  148.     XtManageChild(child);
  149.  
  150.     /* Add a new work area. This can be any manager. */
  151.     child = XmCreateForm(SomeDialog, "someForm", NULL, 0);
  152.     XtManageChild(child);
  153.  
  154.     /* and fill it up... */
  155.     something = doYourStuff(child);
  156.  
  157.  
  158.  
  159. -----------------------------------------------------------------------------
  160. Subject: 103)  How come the title bars for my dialogs now have "_popup" or
  161. "<-popup" concatenated onto the widget name?
  162.  
  163.  
  164. Answer: Motif 1.0.3 (?) "fixed" things such that title bars without an
  165. explicit dialogTitle setting use the widget name with "_popup" or whatever
  166. added on.  Set the dialogTitle resource explicitly if you don't want this new
  167. default naming scheme.
  168.  
  169. -----------------------------------------------------------------------------
  170. Subject: 104)  How can I force a dialog window to display?  I manage a
  171. "working" dialog, and do some computing, but the dialog window appears blank
  172. until the work has finished.  How can I force it to be displayed?
  173.  
  174. Answer: Use this.  (David Brooks, Systems Engineering, Open Software
  175. Foundation)
  176.  
  177. /*
  178.  * This procedure will ensure that, if a dialog window is being mapped,
  179.  * its contents become visible before returning.  It is intended to be
  180.  * used just before a bout of computing that doesn't service the display.
  181.  * You should still call XmUpdateDisplay() at intervals during this
  182.  * computing if possible.
  183.  *
  184.  * The monitoring of window states is necessary because attempts to map
  185.  * the dialog are redirected to the window manager (if there is one) and
  186.  * this introduces a significant delay before the window is actually mapped
  187.  * and exposed.  This code works under mwm, twm, uwm, and no-wm.  It
  188.  * doesn't work (but doesn't hang) with olwm if the mainwindow is iconified.
  189.  *
  190.  * The argument to ForceDialog is any widget in the dialog (often it
  191.  * will be the BulletinBoard child of a DialogShell).
  192.  */
  193.  
  194. ForceDialog(w)
  195.      Widget w;
  196. {
  197.   Widget diashell, topshell;
  198.   Window diawindow, topwindow;
  199.   Display *dpy;
  200.   XWindowAttributes xwa;
  201.   XEvent event;
  202.   XtAppContext cxt;
  203.  
  204. /* Locate the shell we are interested in.  In a particular instance, you
  205.  * may know these shells already.
  206.  */
  207.  
  208.   for (diashell = w;
  209.        !XtIsShell(diashell);
  210.        diashell = XtParent(diashell))
  211.     ;
  212.  
  213. /* Locate its primary window's shell (which may be the same) */
  214.  
  215.   for (topshell = diashell;
  216.        !XtIsTopLevelShell(topshell);
  217.        topshell = XtParent(topshell))
  218.     ;
  219.  
  220.   if (XtIsRealized(diashell) && XtIsRealized(topshell)) {
  221.     dpy = XtDisplay(topshell);
  222.     diawindow = XtWindow(diashell);
  223.     topwindow = XtWindow(topshell);
  224.     cxt = XtWidgetToApplicationContext(diashell);
  225.  
  226. /* Wait for the dialog to be mapped.  It's guaranteed to become so unless... */
  227.  
  228.     while (XGetWindowAttributes(dpy, diawindow, &xwa),
  229.            xwa.map_state != IsViewable) {
  230.  
  231. /* ...if the primary is (or becomes) unviewable or unmapped, it's
  232.    probably iconified, and nothing will happen. */
  233.  
  234.       if (XGetWindowAttributes(dpy, topwindow, &xwa),
  235.           xwa.map_state != IsViewable)
  236.         break;
  237.  
  238. /* At this stage, we are guaranteed there will be an event of some kind.
  239.    Beware; we are presumably in a callback, so this can recurse. */
  240.  
  241.       XtAppNextEvent(cxt, &event);
  242.       XtDispatchEvent(&event);
  243.     }
  244.   }
  245.  
  246. /* The next XSync() will get an expose event if the dialog was unmapped. */
  247.  
  248.   XmUpdateDisplay(topshell);
  249. }
  250.  
  251.  
  252. -----------------------------------------------------------------------------
  253. Subject: 105)  How can I control placement of a popup widget?  Each time a
  254. popup is created, it is placed in or over the middle of its parent.  How can I
  255. make it obey the XmNx and XmNy values?
  256.  
  257. Answer: Set the resource XmNdefaultPosition for the popup to False.  Set the
  258. position of the popup by the resource values of XmNx and XmNy.  Do not use
  259. XtMoveWidget, as this is for widget writers only.  Here's a demo program from
  260. Dan Heller:
  261.  
  262. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  263.  * This program is freely distributable without licensing fees and
  264.  * is provided without guarantee or warranty expressed or implied.
  265.  * This program is -not- in the public domain.  This program is
  266.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  267.  */
  268.  
  269. /* map_dlg.c -- Use the XmNmapCallback to automatically position
  270.  * a dialog on the screen.  Each time the dialog is displayed, it
  271.  * is mapped down and to the right by 200 pixels in each direction.
  272.  */
  273. #include <Xm/MessageB.h>
  274. #include <Xm/PushB.h>
  275.  
  276. /* main() --create a pushbutton whose callback pops up a dialog box */
  277. main(argc, argv)
  278. char *argv[];
  279. {
  280.     Widget toplevel, button;
  281.     XtAppContext app;
  282.     void pushed();
  283.  
  284.     toplevel = XtVaAppInitialize(&app, "Demos",
  285.         NULL, 0, &argc, argv, NULL, NULL);
  286.  
  287.     button = XtCreateManagedWidget("button", xmPushButtonWidgetClass,
  288.         toplevel, NULL, 0);
  289.     XtAddCallback(button, XmNactivateCallback, pushed, "Hello World");
  290.  
  291.     XtRealizeWidget(toplevel);
  292.     XtAppMainLoop(app);
  293. }
  294.  
  295. /* callback function for XmNmapCallback.  Position dialog in 200 pixel
  296.  * "steps".  When the edge of the screen is hit, start over.
  297.  */
  298. static void
  299. map_dialog(dialog, client_data, cbs)
  300. Widget dialog;
  301. XtPointer client_data;
  302. XmAnyCallbackStruct *cbs;
  303. {
  304.     static Position x, y;
  305.     Dimension w, h;
  306.  
  307.     XtVaGetValues(dialog, XmNwidth, &w, XmNheight, &h, NULL);
  308.     if ((x + w) >= WidthOfScreen(XtScreen(dialog)))
  309.         x = 0;
  310.     if ((y + h) >= HeightOfScreen(XtScreen(dialog)))
  311.         y = 0;
  312.     XtVaSetValues(dialog, XmNx, x, XmNy, y, NULL);
  313.     x += 200, y += 200;
  314. }
  315.  
  316. /* pushed() --the callback routine for the main app's pushbutton.
  317.  * Create and popup a dialog box that has callback functions for
  318.  * the Ok, Cancel and Help buttons.
  319.  */
  320. void
  321. pushed(w, message)
  322. Widget w;
  323. char *message; /* The client_data parameter passed by XtAddCallback */
  324. {
  325.     Widget dialog;
  326.     Arg arg[3];
  327.     XmString t = XmStringCreateSimple(message);
  328.     extern void response();
  329.  
  330.     XtSetArg(arg[0], XmNautoUnmanage, False);
  331.     XtSetArg(arg[1], XmNmessageString, t);
  332.     XtSetArg(arg[2], XmNdefaultPosition, False);
  333.     dialog = XmCreateMessageDialog(w, "notice", arg, 3);
  334.     XmStringFree(t);
  335.  
  336.     XtAddCallback(dialog, XmNmapCallback, map_dialog, NULL);
  337.  
  338.     XtManageChild(dialog);
  339.     XtPopup(XtParent(dialog), XtGrabNone);
  340. }
  341.  
  342.  
  343. -----------------------------------------------------------------------------
  344. Subject: 106)  TOPIC: LANGUAGE BINDINGS
  345.  
  346. -----------------------------------------------------------------------------
  347. Subject: 107)  Is there a C++ binding for Motif?
  348.  
  349. [Last modified: May 93]
  350.  
  351.  
  352. Answer: WWL is a library which defines C++ classes around X Toolkit Widgets.
  353. It is intended to simplify the task of C++ code writers when using the Toolkit
  354. by providing them with C++ objects, methods, type checking and several utility
  355. functions and classes.
  356.  
  357. WWL has been tested under SunOs4.0.3 on sun3 and sun4, HPUX version 6.5 and
  358. 7.0 and Ultrix 4.0 on DECstation 3100 and 5000. It is expected to work on most
  359. other UNIX systems without too many problems.
  360.  
  361. WWL is distributed as a tar file with all the source, documentation and
  362. example. The file is available using anonymous ftp from
  363.  
  364.         export.lcs.mit.edu (18.30.0.238   contrib/WWL-1.0.tar.Z
  365.         lri.lri.fr (129.175.15.1)      pub/WWL-1.0.tar.Z
  366.  
  367.  
  368. Answer: Rogue Wave Software has a C++ binding for Motif called View.h++.
  369.  
  370. "View.h++ is a complete C++ interface to OSF/Motif.  It doesn't just
  371. encapsulate it, but also includes a set of classes that provide a level of
  372. abstraction above Motif, thus simplifying menu and dialog creation, XmStrings,
  373. XmFontLists, etc.  View.h++ supports a Model- View-Controller architecture,
  374. allowing for an even more object-oriented interface design.  Includes a copy
  375. of Rogue Wave's Tools.h++ (foundation class library)"
  376.  
  377. An object license is $795 "per seat" and a source code license is available
  378. for $2,995 "per seat."  Rogue Wave also offers full support for View.h++.
  379.  
  380. It is currently available for Sun Sparc, IBM RS/6000, HP 9000/700 series, SCO,
  381. Intel SVR4 ESIX.  Please call for Silicon Graphics and DEC Ultrix status.
  382.  
  383. For additional information, please contact:
  384.  
  385. Matt Steinauer
  386. Rogue Wave Software, Inc.
  387. P.O. Box 2328
  388. Corvallis, OR 97339
  389. Phone: (503)754-3010
  390. Fax:   (503)757-6650
  391.  
  392. email:   matts@roguewave.com
  393.  
  394.  
  395. Answer: From Andreas.Baecker@gmd.de: The GINA++ application framework contains
  396. an encapsulation of the OSF/Motif widg et classes and the Xt functionality
  397. into C++ classes. Its functionality is comparab le to that of the ULowell
  398. binding and the WWL. Additionally, it provides an easy-to -use framework for
  399. modeling new composite and primitive widget classes, plus an application
  400. framework similar to ET++ or MacApp build on top of it. The binding may be
  401. used independently from the framework classes. GINA++ is available through
  402. anonymous ftp from ftp.gmd.de [129.26.8.90] in the directory /gmd/ginaplus.
  403. Documentation about the Motif binding has been published in the X Resource
  404. Journ al, Number 2, 1992, Pages 106-130. The binding compiles with AT&T C++
  405. 2.1 and GNU G+ + 2.1 and has been tested on SunOS 4.1.[12], X11R4 and Motif
  406. 1.1.3.
  407.  
  408. Answer: Motif++ is a library that defines C++ class "wrappers" for the widgets
  409. defined in the OSF/Motif-1.1 widget library. Motif++ is also an application
  410. toolkit that provides other tools in conjunction with the widget wrapper
  411. classes.  It has support for the Xbae widget set, plus other widgets.  It has
  412. Imake support, and lots of test files.
  413.  
  414. Motif++ is very similar to other public domain widget libraries such as The
  415. Widget Wrapper Library (WWL) and the C++ Binding for OSF/Motif developed at
  416. the Univeristy of Lowell. The two latter libraries are the result of much
  417. larger efforts.
  418.  
  419. Availability:
  420.  
  421. Anonymous ftp at decuac.dec.com (192.5.214.1), directory /pub/X11,
  422. file motif++.21.jul.92.tar.Z (855293 bytes).
  423.  
  424. For more information, contact Ronald van Loon (rvloon@cv.ruu.nl) There is also
  425. mailing list for Motif++. Send e-mail to 'motif++-request@cv.ruu.nl' or
  426. 'rvloon@cv.ruu.nl'
  427.  
  428. Answer: From Christian Goeller (goeller@seufert.de): We have a C++-class-
  429. library available. It's based on the Lowell-bindings and the work of Ronald
  430. van Loon (rvloon@cv.ruu.nl) and has a lot of (i hope) useful enhancements like
  431. containers, string-class (with Motif-support) and a graph-object.  It should
  432. build completely with imake.  You could ftp it from:
  433.  
  434. Host: ftp.unibw-muenchen.de
  435. File: /pub/Motif-C++/v2.0.tar.Z
  436.  
  437.  
  438. Answer: Xm++ is a user interface framework for the C++ language built upon X11
  439. and the X-Toolkit. It is designed to be a simple and intuitive programming
  440. interface to access the functionality of commonly used widgets.  Xm++ was
  441. initially created for the Motif widget set, now support for the Athena widgets
  442. was added. Applications created with Xm++ run in both environments without
  443. changes, although many nice features are only available when using Motif.
  444.  
  445. Xm++ is available on: export.lcs.mit.edu as: /contrib/Xm++.0.5.tar.Z
  446.  
  447. Answer: The Solbourne OI toolkit (not Motif) also has a C++ binding.
  448.  
  449. Answer: Liant have C++/Views.
  450.  
  451. Answer: Quest have ObjectViews.
  452.  
  453. Answer: Doug Young has written a book "Object Oriented Programming with C++
  454. and Motif", Prentice-Hall ISBN 0-13-630252-1 about using C++ without requiring
  455. one of these toolkits.
  456.  
  457. -----------------------------------------------------------------------------
  458. Subject: 108)  How can I have a C++ member function in a callback?
  459.  
  460. [Last modified: October 93]
  461. Answer: There are three common user problems with C++ callbacks.  First, make
  462. sure you use the correct function prototype for the function declarations.
  463. Second, the callback function must be declared as a static member of the
  464. class.  Third, when registering it with XtAddCallback(), you must use its full
  465. signature.  For example: (Ken Lee klee@synoptics.com)
  466.  
  467.  
  468.     class MyClass {
  469.         ...
  470.         void createWidgets();
  471.         static void myButtonCB(Widget, XtPointer, XtPointer);
  472.         ...
  473.     };
  474.     void MyClass::createWidgets() {
  475.         ...
  476.         w = XtCreatePushButton(...);
  477.         XtAddCallback(w, XmNactivateCallback, &MyClass::myButtonCB,
  478.             (XtPointer) this);
  479.         ...
  480.     }
  481.     void myButtonCB(Widget w, XtPointer clientData, XtPointer callData) {
  482.         MyClass *myclass = (MyClass *) clientData;
  483.         ...
  484.     }
  485.  
  486. Note that the "this" pointer is used as the client data.  This technique is
  487. popular, but not required.
  488.  
  489.  
  490. Motif++ has a nice tutorial summarising mechanisms (this is available
  491. separately by email from Ronald van Loon (rvloon@cv.ruu.nl)). Doug Young's
  492. book deals extensively with one of these. The problem is that you don't get
  493. the object when you just use the function as a callback.  You need to pass the
  494. object as a pointer through as the client_data.  (use "this" as the
  495. client_data.) Then you can retrieve the object's address, and dereference from
  496. there. For example (Leo O'Donnell, Email: leo@avs.com),
  497.  
  498.     class MyButton {
  499.       public:
  500.                 MyButton (Widget parent, const char *name) {
  501.                     _button = XtVaCreateManagedWidget (
  502.                         name, xmPushButtonWidgetClass, parent, NULL, 0);
  503.                     XtAddCallback (
  504.                         _button,
  505.                         XmNactivateCallback,
  506.                         &MyButton::activateCB,
  507.                         (XtPointer) this);
  508.                 }
  509.                 ~MyButton () { XtDestroyWidget (_button); }
  510.       private:
  511.         Widget  _button;
  512.         static  void activateCB (Widget, XtPointer, XtPointer);
  513.     };
  514.  
  515.     void MyButton::activateCB (Widget, XtPointer thisBtn, XtPointer)
  516.     {
  517.         MyButton *btn = (MyButton *) thisBtn;
  518.  
  519.         // OK you've got the button instance now. Do some stuff with it!
  520.     }
  521.  
  522.  
  523.  
  524. -----------------------------------------------------------------------------
  525. Subject: 109)  Is there a Common Lisp binding for Motif?
  526.  
  527. [Last modified: November 92]
  528.  
  529. Answer: Try CLM. This includes a toolkit demon (in C) that takes a widget
  530. description (with callbacks), and forks a new process for each Motif
  531. application (which can be just a single menu, or whatever).  Lisp can then
  532. continue running, with a separate lightweight lisp process handling the
  533. connection & callbacks.  In North America & net environs, CLM-2.0beta is
  534. available from export.lcs.mit.edu.
  535.  
  536. There is also CLIM, the Common Lisp Interface Manager. It provides access to
  537. motif and other toolkits and window systems.  Here is some blurb: "Version 2.0
  538. of the Common Lisp Interface Manager (CLIM) provides access to Motif. CLIM is
  539. the emerging standard for GUI development in Common Lisp.  It offers a set of
  540. high-level facilities that enable rapid construction of user interfaces.
  541. Applications written using CLIM are portable across a variety of window
  542. systems and toolkits.  For example, on the X window System, both Motif
  543. (OSF/Motif) and Openlook (OLIT) are supported.  CLIM accesses the toolkit
  544. directly rather than emulating the look and feel."
  545.  
  546. CLIM is available from a variety of Common Lisp vendors including Symbolics
  547. and Franz Inc. (info@franz.com).
  548.  
  549.  
  550. -----------------------------------------------------------------------------
  551. Subject: 110)  Is there an Ada binding for Motif?
  552.  
  553. [Last modified: July 93]
  554.  
  555. Answer:
  556.  
  557. Information on Ada bindings to Motif and other services (such as SQL and
  558. POSIX) can be found in a document maintained by the Ada Information
  559. Clearinghouse.  The report can be found at
  560.  
  561.         host:   ajpo.sei.cmu.edu
  562.         loc:    /public/ada-info/bindings.hlp.*
  563.         access: anonymous ftp
  564.  
  565. The suffix to the file (indicated above with an asterix) is the date of the
  566. latest update to the document.  For example, the full name of the report
  567. updated on 14 June 1993 would be
  568.  
  569.         /public/ada-info/bindings.hlp.14Jun93.
  570.  
  571. The file is ASCII.
  572.  
  573. ------ Included File
  574.  
  575.  
  576. [...Excerpted from the AdaIC report bindings.hlp.14Jun93...]
  577. [...Updates can be found on ajpo.sei.cmu.edu, in the    ...]
  578. [...file /public/ada-info/bindings.hlp.*  The suffix    ...]
  579. [...is always the date of the lastest version to the    ...]
  580. [...report.                                             ...]
  581.  
  582.                                      SECTION 12
  583.                                   X-Window System:
  584.                                OSF Motif and Open Look
  585.                                Available Ada Bindings
  586.  
  587.  
  588. 12.1  Description and Standardization Efforts
  589.  
  590. The X-Window System is a network-transparent window system.  It supports one
  591. or more screens containing overlapping windows or subwindows.  X display
  592. servers distribute user input to and accept output requests from various
  593. client programs located either on the same machine or elsewhere in the
  594. network.
  595.  
  596.             OSF Motif (Open Software Foundation/Motif) is a graphical user
  597.             interface from OSF that provides a Presentation Manager look and
  598.             feel for applications running on any system with X Window version
  599.             11.  It conforms to POSIX, ANSI C and X/Open's XPG3 standards.
  600.  
  601. 12.2  Resources Available from Software Reuse Libraries/Repositories
  602.  
  603.  
  604. ASSET                                                      (Updated:  November
  605. 1 992)
  606.  
  607. The following information was taken in its entirety from the ASSET Library
  608. Repository Catalog, October 9, 1992.  For more information on ASSET, see
  609. Appendix C.
  610.  
  611.  
  612. INTERFACE TO THE X WINDOW SYSTEM
  613.  
  614. VERSION_NUMBER    : 1.1
  615. DEVELOPED_BY      : SAIC
  616. RELEASE_DATE      : 29-SEP-88
  617. UNIQUE_IDENTIFIER : ASSET_A_240
  618. ALTERNATE_NAME    : SAICX2
  619. ASSET_TYPE        : SOFTWARE CODE
  620. FUNCTIONS         : INTERFACE, BIND
  621. OBJECTS           : ADA, X WINDOWS
  622. KEYWORDS          : STANDARDS, BINDINGS
  623. COLLECTION        : STARS FOUNDATIONS
  624. DISTRIBUTION      : UNLIMITED
  625.  
  626. DESCRIPTION       :
  627.  
  628. Interface to the X Window System
  629.       An expression of the various concepts in Ada that provides a full,
  630. working Ada specification of the X Window system.
  631.      Approved for public release; distribution is unlimited.
  632.  
  633. 12.3  Products Available from Vendors
  634.  
  635.  
  636. Advanced Technology Center                                 (Updated:  November
  637. 1 992)
  638.  
  639. The Advanced Technology Center (ATC) has an Ada binding to OSF Motif for their
  640. AXI~ product.  AXI is currently available for most UNIX-based platforms, and
  641. is supported by Verdix, Meridian, and TeleSoft compilers.
  642.  
  643. AXI is an Ada-to-X-Window System interface that provides the Ada programmer
  644. access to the 500+ functions, libraries, and procedures contained in the X
  645. library (Xlib), the X Toolkit (Xt), the X Extensible Library, the X
  646. Miscellaneous Utilities, the Motif widget set and the Motif Resource Manager.
  647.  
  648. ATC is planning to develop an Ada binding to Open Look for AXI.
  649.  
  650. For more information, contact:Larry Paulson, Advanced Technology Center, 22982
  651.                         Mill Creek Drive, Laguna Hills, CA  92653, USA; Phone:
  652.                         714-583-9119
  653.  
  654.  
  655. Alsys, Inc.                                                     (Updated:  May
  656. 1 992)
  657.  
  658. The Alsys Ada Software Development Environment (Alsys's validated Ada compiler
  659. #901221W1.11103) for 386 UNIX is a production-quality Ada environment capable
  660. of handling very large Ada applications (over 500,000 lines of code).  The
  661. product includes the Compiler; Multi-Library Environment, which provides a
  662. powerful and flexible way to manage Ada development effort and share program
  663. units; Binder, which supports unused subprograms elimination; High-and Low-
  664. Level Optimizers for improving code quality and performance; and Run-Time
  665. Executive for efficient support for executing Ada programs.  Also included is
  666. the Developer's Toolset including:  Ada Probe, a symbolic source level
  667. debugger and program viewer; AdaXref, a cross-reference generator; AdaMake, a
  668. recompilation aid; AdaReformat, a source reformatter.
  669.  
  670. Alsys currently has Ada bindings to POSIX, X-Windows (OSF Motif), and the
  671. Generic Package of Elementary Functions for the Alsys Ada Software Development
  672. Environment, running on 386 UNIX 386/486-based machines supported as both host
  673. and target and running 386/ix or SCO UNIX.  They are also planning a binding
  674. to SQL for  386/486 machines.
  675.  
  676. Host/Target:386/486 PC under IX UNIX, 386/486 PC under SCO UNIX
  677.  
  678. The Alsys Ada Software Development Environment for the IBM RS/6000 is a
  679. production-quality Ada environment capable of handling very large Ada
  680. applications.  Hosted on and targeted to the IBM RS/6000 workstation under
  681. IBM's AIX operating system, the product includes the Compiler; Multi-Library
  682. Environment, which provides a  powerful and flexible way to manage Ada
  683. development efforts and share program units; Binder; Run-Time Executive; and
  684. both a High and Low-Level Optimizer for improving code quality and
  685. performance.  Also included is the Alsys Ada Toolset including Ada Probe,
  686. symbolic source level debugger and program viewer; AdaXref, cross-reference
  687. generator; AdaMake, recompilation aid; and AdaReformat, source reformatter.
  688.  
  689. Alsys has bindings currently available to the Generic Package of Elementary
  690. Functions and to X-Windows (OSF Motif) for the Alsys Ada Development
  691. Environment for the IBM RS/6000 running on any RISC System/6000 machine as
  692. both host and target and running IBM's AIX operating system (Alsys's validated
  693. Ada compiler #910809W1.11195).   Alsys also plans to develop a POSIX binding
  694. for the RS/6000.
  695.  
  696. Host/Target:RISC System/6000 under AIX
  697.  
  698. The Alsys Ada Software Development Environment for SPARC Workstations is a
  699. production-quality Ada environment capable of handling very large Ada
  700. applications.  Hosted on any SPARC-based workstation under SunOS or SunView,
  701. the product helps you realize the full potential of Ada on SPARC machines. The
  702. product includes the Compiler (with High- and Low-Level Optimizers); Binder,
  703. which supports unused subprogram elimination; Multi-Library system (Family,
  704. Library, and Unit Managers) which provides a powerful and flexible way to
  705. manage Ada development efforts and share program units;  AdaExec real-time
  706. executive, for complete and efficient support for executing Ada programs; and
  707. ISO-standard mathematical library.  Also included is the Alsys Ada Toolset
  708. including AdaProbe, symbolic source level debugger and program viewer;
  709. AdaXref, cross-reference  generator; AdaMake, recompilation aid; and
  710. AdaReformat, source reformatter.
  711.  
  712. Bindings to the Generic Package of Elementary Functions and to OSF/Motif are
  713. currently available for the Alsys Ada Software Development Environment running
  714. on any SPARC-based Workstation as both host and target and running SunOS or
  715. SunView.
  716.  
  717. Host/Target:SPARC under SUNOS
  718.  
  719. For more information, contact:Scott Garren, Alsys, Inc., 67 South Bedford
  720.                         Street, Burlington, MA  01803-5152, USA;  Phone:
  721.                         (617) 270-0030
  722.  
  723.  
  724. Digital Equipment Corporation                              (Updated:  November
  725. 1 992)
  726.  
  727. Digital Equipment Corporation has bindings available for GKS, PHIGS, SQL, and
  728. OSF Motif for VAX Ada/VMS.  The Ada bindings are provided either as part of a
  729. compiler product or the services/facilities that are provided by Digital and
  730. its suppliers.
  731.  
  732. Host/Target:DEC VAX under VMS
  733.  
  734. For more information, contact:Mary Anne Cacciola, Digital Equipment
  735.                         Corporation, 110 Spit Brook Road, Nashua, NH  03062,
  736.                         USA; Phone:  (603) 881-1028
  737.  
  738.  
  739. IBM                                                        (Updated:  November
  740. 1 992)
  741.  
  742. IBM's AIX Ada/6000 product provides a binding to GPEF and IBM AIXWindows (X-
  743. Windows ... not Motif).  It runs on all models of the IBM RISC System/6000
  744. under the IBM AIX Version 3.2 operating system. See also entries for Systems
  745. Engineering Research Corporation (SERC) and Advanced Technology Center (ATC)
  746. for Motif, GKS or PHIGS bindings for use with IBM AIX Ada/6000 products.
  747.  
  748.  
  749. The AIX Ada/6000 licensed programs (5706-291 and 5706-294) consist of an
  750. optimizing compiler, a run-time environment, a symbolic debugger, an Ada
  751. "makefile" generator for use in automating and minimizing recompilation, Ada
  752. library management tools and Ada language bindings to some key AIX subsystems.
  753. With the exception of some system-specific aspects of the language, the Ada
  754. language for the AIX operating system is source compatible with the Ada
  755. language supported by IBM licensed programs in VM/CMS and MVS.
  756.  
  757. Host/Target:IBM RISC System/6000 under the IBM AIX Version 3.2 operating
  758.             system
  759.  
  760. This product conforms to the following standards:  ANSI/MIL-STD-1815A - Ada at
  761. current level (1.11) of the ACVC test suite.
  762.  
  763. For more information, contact:Barry Lee, IBM Corporation, 844 Don Mills Road,
  764.                         North York, Ontario, Canada  M3C 1V7; Phone:  (416)
  765.                         448-3174; Fax: (416) 448-4810
  766.  
  767. Objective Interface Systems, Inc.                          (Updated:  November
  768. 1 992)
  769.  
  770. Objective Interface Systems, Inc., has an Ada binding to X-windows (OSF Motif)
  771. for its Screen Machine~ product.  The Screen Machine binding to Motif includes
  772. a WYSIWYG drawing tool and an Ada code generator.
  773.  
  774. Host/Target:
  775.  
  776.       Sun SPARC/SunOS         Rational R1000/Delta    HP 9000/7XX; 8X7
  777.       IBM RISC System/6000/AIXPC 386/486/ISC UNIX     HFSI WIS Workstation
  778.       PC 286/386/486/MS-DOS   PC 386/486/SCO UNIX     DEC Ultrix; DEC VMS
  779.  
  780. For more information, contact:Phil Carrasco, Object Interface Systems, Inc.
  781.                         1895 Preston White Drive, Suite 250, Reston, VA
  782.                         22091-5448, USA; Phone: (703) 264-1900; Fax:
  783.                         703-264-1721; email info@ois.com (internet)
  784.  
  785.  
  786. SL Corporation                                              (Updated: November
  787. 1 992)
  788.  
  789. SL Corporation's SL-GMS toolkit includes Ada bindings to GPEF, GPPF, POSIX,
  790. SQL, TCP/IP, OSF/Motif, and Open Look.
  791.  
  792. SL-GMS is a toolkit for developing dynamic graphics screens for real-time or
  793. highly interactive applications.  Non-programmers can design application
  794. screens in a standard drawing-tool mode, connect them to real-time data
  795. sources and animate screen objects to visualize changing data values.  SL-GMS
  796. allows the design of custom "GISMOs" to input values or control the
  797. application and supports MOTIF, OPEN LOOK and other X toolkit widgets.
  798.  
  799. SL-GMS is used extensively to provide real-time graphics for applications in
  800. the fields of manufacturing, process control, network management, avionics and
  801. financial tracking.
  802.  
  803. Host/Target:Validated Verdix and DEC compilers support SL-GMS for the
  804.             following machines as both host and target:
  805.  
  806.  
  807.       DEC-DECstation/ULTRIX 4.0DEC-VAXstation/ULTRIX 4.0
  808.       DEC-VAXstation/VMS 5.4  DEC-VAXstation/VMS 5.5
  809.  
  810.       IBM-RS6000/AIX
  811.  
  812.       HP-9000/300/UNIX        HP-9000/400/UNIX
  813.       HP-9000/800/UNIX        HP-9000/700/UNIX
  814.  
  815.       PC-386/IX UNIX          PC-386/SCO UNIX
  816.       PC-386/Lynx             PC-386/0S2
  817.       PC-386/System 5.4
  818.  
  819.       SGI-4D/IRIX 3.3
  820.  
  821.       Sun-3/SunOS 4.1         SunSPARC/SunOS 4.1
  822.  
  823.       88 Open/BCS Compliant
  824.  
  825. For more information, contact: Mike Meagher, SL Corporation, 240 Tamal Vista
  826.                         Boulevard, Corte Madera, CA  94926, USA Phone: (415)
  827.                         927-1724; Fax: (415) 927-2931
  828.  
  829.  
  830. Sunrise Software International                                  (Updated:  May
  831. 1 992)
  832.  
  833. Sunrise Software International's product, ezx, is a rapid application
  834. development tool that automates the creation of graphical user interfaces for
  835. OSF/MOTIF and generates C, UIL, or Ada.  ezx provides WYSIWYG screen layout;
  836. color, font and pixmap editors; presentation tools and dialog management.  A
  837. prototype can be developed in hours and using a script language similar to
  838. Hypertalk, demonstrated to end-users before the first line of code is written.
  839. Then portable C, UIL or Ada can be generated automatically.  Ada bindings are
  840. provided.  The total code required to develop a GUI is reduced by
  841. approximately 75%.   The appearance and behavior of the GUI is defined in an X
  842. resource file which the application loads at run time.  This provides explicit
  843. separation between the GUI and the computational core of the application. Thus
  844. the GUI can be revised without recompiling (and retesting) the application.
  845.  
  846. ezx provides cost savings throughout the software development cycle, from
  847. requirements analysis through design, code, test and maintenance.
  848.  
  849.  
  850. Host/Target:DEC RISC under ULTRIX, DEC VAX under VMS, IBM 386 under UNIX, IBM
  851.             RS 6000 under AIX, SGI under , SUN SPARC under UNIX
  852.  
  853. For more information, contact:Frederick Sells, Sunrise Software International,
  854.                         170 Enterprise Center, Middletown, RI  02840, USA;
  855.                         Phone:  401-847-7868
  856.  
  857. Systems Engineering Research Corporation (SERC)            (Updated:  November
  858. 1 992)
  859.  
  860. SERC's Ada/MOTIF is a complete binding to X Window and OSF/Motif for the Ada
  861. programming language that was based in part upon the SAIC/Unisys (STARS)
  862. public domain bindings.  That work was leveraged as a starting point for this
  863. development; many of the bug fixes and additional capabilities beyond the
  864. public domain releases in Ada/MOTIF have been incorporated.  Most noteworthy
  865. are the capabilities included in Ada/Motif for Ada tasking, callback
  866. registration, memory leak detection/prevention and capabilities for developing
  867. customized widgets.  Paramax/STARS considers Ada/Motif to be the commercial
  868. version of their STARS bindings, according to SERC.
  869.  
  870. Ada/MOTIF is supported by the ALSYS, VERDIX, SUNAda, IBM Ada, and SGI Ada
  871. compilers.
  872.  
  873.  
  874. Host/Target:SUN 4, HP 300/400, HP 700, IBM RS 6000, SGI, 386
  875.             SUN OS 4.1.1, SOLARIS 2.0 (coming), HPUX 8.0, SGI 3.2 & 4.0, IBM
  876.             ATX 3.2, SCO 3.2
  877.  
  878. For more information, contact:Theo Kusiolek or Scott Cleveland, Systems
  879.                         Engineering Research Corporation (SERC), 2555
  880.                         Charleston Road, Mountain View, CA  94043, USA; Phone:
  881.                         800-ADA-SERC or 415/962-9092; Fax:  415/962-0330;
  882.                         E-mail:  Well!sercmail@apple.com.
  883.  
  884.  
  885. TeleSoft                                                   (Updated:  November
  886. 1 992)
  887.  
  888. TeleSoft's TeleUSE/Ada automates the creation of OSF/Motif graphical user
  889. interfaces for Ada applications.  It includes a special version of the TeleUse
  890. User Interface Management System -- which generates Ada source code -- and Ada
  891. bindings to the TeleUSE run-time routines.
  892.  
  893. TeleUse/Ada tools allow a GUI to be prototyped and designed using a WYSIWYG
  894. editor and a PDL, and also includes tools for debugging, generating production
  895. code and maintaining the GUI.  TeleUse/Ada can save the developer up to 90
  896. percent of the time required to hand code X Window System GUIs.
  897.  
  898. Host/Target:SPARC under UNIX, Sun-4 under UNIX
  899.  
  900.  
  901. TeleSoft's TeleWindows is a set of Ada bindings to the X Window System and
  902. OSF/Motif.  This includes Xlib, XT, X extensions Library, XT+, X miscellaneous
  903. utilities, Motif widget set, XM, MWM, Motif resource manager.  It supports X-
  904. 11 R4 and is not based on the public domain version.  It closely follows the C
  905. Xlib syntax and allows Ada applications to co-exist with C applications.
  906.  
  907. Host/Target:IBM System/370 under VM/CMS
  908.  
  909. For more information, contact:Karen Johnson, TeleSoft, 5959 Cornerstone Court
  910.                         West, San Diego, CA  92121-9891, USA; Phone:  (619)
  911.                         457-2700
  912.  
  913. Verdix                                                          (Updated:  May
  914. 1 992)
  915.  
  916. The Verdix Ada Development System (VADS), is a complete Ada Compiler System
  917. offering a fully validated Ada compiler with chapter 13 support.  Verdix
  918. supplies VADSself and VADScross.   VADSself provides a complete toolset for
  919. self-targeted applications.  It easily interfaces to databases, windowing
  920. systems and program management tools.  VADScross provides real-time support
  921. for host-to-target system development.  VADScross produces small and fast
  922. object code.  VADS is hosted on the largest number of platforms and targets
  923. the greatest number of microprocessors.
  924.  
  925. Host/Target:88000 BCS under UNIX, DEC VAX under VMS / ULTRIX / UNIX,
  926.             DECStation (RISC) under UNIX, DECSystem (RISC) under UNIX, HP 9000
  927.             Series 300 under HP-UX  (UNIX), IBM PS/2 under AIX  (UNIX), IBM
  928.             RISC System/6000 under AIX, SCO Systems V/386 (ABI) under UNIX,
  929.             Sun SPARC systems under UNIX, Sun-3 systems under UNIX
  930.  
  931. Verdix AXI provides an Ada binding to the full Motif, Xt, and Xlib libraries.
  932. The product works with user-supplied Motif 1.1 and X11R4 libraries regardless
  933. of source.
  934.  
  935. Host/Target:DEC RISC under Ultrix, IBM RS6000 under AIX, MIPS under MIPSos,
  936.             Sun-4 under SunOS, Sys V386 under ISC UNIX, Sys V386 under SCO
  937.             UNIX
  938.  
  939. For more information, contact:Tim Ruhe, Verdix Corporation, 205 Van Buren,
  940.                         Herndon, VA  22070, USA; Phone:  (703) 318-5800
  941.  
  942.  
  943. -----------------------------------------------------------------------------
  944. Subject: 111)  Is there a Poplog binding for Motif?
  945.  
  946. [Last modified: May]
  947.  
  948. Answer:
  949.  A integrated programming environment consisting of the programming
  950.     languages Pop-11, Prolog, Standard ML, and Lisp which are compiled
  951.     to machine code via a common virtual machine. Pop-11 provides a rich
  952.     interface to the X Toolkit which can be accessed from all other
  953.     Poplog languages. The OLIT, Motif, and Athena widget sets are
  954.     supported, in addition to the custom Poplog (Xpw) widget set. XVed
  955.     provides a sophisticated, customisable multi-window editor. Under
  956.     OPEN LOOK and Motif the Poplog User Interface (PUI) provides a
  957.     graphical interface to the Poplog system. High-level Pop-11
  958.     libraries allow graph drawing, turtle graphics, and the simple
  959.     creation of basic button/menu based interfaces.
  960.  
  961. Contact:
  962.  
  963.     UK EDUCATION SITES:
  964.         Poplog Sales. School of Cognitive and Computing Sciences.
  965.         Brighton. BN1 9QN. England.
  966.         Phone: +44 (0)273 678188
  967.         Email: popsales@cogs.susx.ac.uk
  968.     USA AND CANADIAN EDUCATION SITES:
  969.         Computable Functions Inc. 35 South Orchard Drive. Amherst.
  970.         MA 01002. USA.
  971.         Phone: (413) 253-7637
  972.     ALL OTHER SALES:
  973.         Integral Solutions Ltd. Unit 3, Campbell Court. Bramley.
  974.         Basingstoke. Hampshire. RG26 5EG. England.
  975.         Phone:  +44 (0)256 882028
  976.         Fax:    +44 (0)256 882182
  977.         Email:  isl@integ.uucp
  978.  
  979.  
  980.  
  981. -----------------------------------------------------------------------------
  982. Subject: 112)  TOPIC: SPECIFIC PLATFORMS
  983.  
  984. -----------------------------------------------------------------------------
  985. Subject: 113)  Is it easy to build Motif for a Sun?
  986.  
  987. Answer: See next question for Solaris 2.  No pattern has emerged to problems
  988. about compiling Motif on the Sun (although people seem to have a lot of
  989. different minor problems), and many reports are that it is straightforward.
  990. Read the Motif install instructions (which often have specific reference to
  991. Sun installation), light the blue touch paper and just standback. [My
  992. experience was that I had to add -D_NO_PROTO for 1.1 on a Sparc OS 4.1, and
  993. that was all.  Others have added STRINGS_ALIGNED and NO_REGEXP].
  994.  
  995.  
  996. -----------------------------------------------------------------------------
  997. Subject: 114)  How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?
  998.  
  999. [Last modified: May 93]
  1000.  
  1001. Prepared by Ric Steinberger.  ric@updike.sri.com  4/09/93
  1002.  
  1003. What follows is a description of the steps I used to build Motif 1.2.2 on a
  1004. SUN IPX running Solaris 2.1.  Sun's C compiler (2.0.1) was used.  Many thanks
  1005. go to Kaleb Keithley (kaleb@devvax.jpl.nasa.gov) for several useful
  1006. suggestions.  Other people, including OSF staff, especially David Brooks
  1007. (dbrooks@osf.org), helped as well.  My thanks to you all.
  1008.  
  1009. 1. Build X11R5 from the mit distribution.  You need to retrieve the sources
  1010.    from export.lcs.mit.edu (in pub/R5) and patches 1 - 22 (or 23) (in
  1011.    pub/R5/fixes).  There are several other sites that contain the X11R5
  1012.    sources.  After installing patch 19, apply PEXlib.tar.Z, also available
  1013.    from export.lcs.mit.edu in pub/R5/fixes.  You can apply also
  1014.    R5.Xsun.multi-screen and R5.SunOS5.patch.  There are .README files
  1015.    that explain how to patch.  Be SURE to read
  1016.    R5.SunOS5.patch.README for details on how to BUILD X11.  You probably
  1017.    want to use the ProjectRoot feature in the site.def file in the
  1018.    mit/config directory.  You will NEED to edit that file to do that.
  1019.  
  1020. 2. Obtain the Motif 1.2.2 distribution from OSF (617-621-7300).  You may
  1021.    need to first install the 1.2 tape, then the 1.2.1 and finally the
  1022.    1.2.2 tape.  You might want to do a "chmod -R u+w ." after unloading
  1023.    each tape.
  1024.  
  1025. 3. In the config directory, there are several changes.  Some of the changes
  1026.    are based on R5.SunOS5.patch files.  A complete set of config files
  1027.    relevant to Solaris have been placed in the anon-ftp account of
  1028.    updike.sri.com in pub/motif/solaris21-motif122-config.tar.Z.  They are
  1029.    also available from OSF on their mail response server (available to
  1030.    support contract holders) and they will send them directly to full
  1031.    support contract holders.  Decompress and untar this file in your Motif
  1032.    config subdirectory.  Copy site.def.sample to site.def, then edit
  1033.    site.def.  You will probably want to uncomment the ProjectRoot section
  1034.    and use the same value used in your X11R5 build.  Also, you will probably
  1035.    want to use /usr/ucb/install in you installed the UCB compatibility
  1036.    suite.  Otherwise you might want to use the install supplied at the end
  1037.    of this memo.  [I used the UCB version and can't swear that this works.
  1038.    Bit it should.  Put it someplace like /usr/local/bin and chmod +x it.]
  1039.  
  1040.    There are two patches to consider.  One fixes a cursor problem
  1041.    in ./lib/Xm/TextF.c.  The other removes a Berkeleyism.  These
  1042.    patches should probably be consider unofficial at present.
  1043.    Failure to deal with the Berkeleyism (bzero) means you will need to
  1044.    link with -lucb -lelf.  This will probably work, but why bother?
  1045.    Furthermore, if you move the Motif binaries to a machine without
  1046.    the ucb compatability suite, you won't have the sharable libs you need.
  1047.  
  1048. [The actual patches have been censored because they contain OSF source code]
  1049.  
  1050.    Patch 1: In TextF.c there are several places _XmTextFieldDrawInsertionPoint
  1051. is called. These should be moved two or three lines further down *after* the
  1052. "if (!XtIsRealized(tf)) return True;" statement.
  1053.  
  1054.  
  1055.    patch 2: The call to bzero in lib/Xm/Visual.c should be replaced by the
  1056. equivalent call to memset
  1057.  
  1058.  
  1059.     Both these patches can be applied in the ./lib/Xm directory.
  1060.     If you don't have the patch program (how did you build X11?),
  1061.     you can get it in the vendor/cygnus directory of ftp.uu.net,
  1062.     or you can build it from source.  Be sure to get the latest
  1063.     version (2.0.12.u8).
  1064.  
  1065. 4) Use the README-1.2.1 file as a guideline for building motif.  I followed
  1066.    directions in the section called, "Using X11R5 Installed Libraries
  1067.    and Header Files."  If you make a mistake after your first build
  1068.    attempt, copy Makefile.ini to Makefile before retrying.  You may
  1069.    need to do this in the config subdirectory too, depending on what
  1070.    went wrong.
  1071.  
  1072. 5) After make Makefiles, do make includes, make depend, then make (or
  1073.    as OSF recommends, make -k).  This gets as far as motifshell in the
  1074.    demos, which fails to build because O_RDONLY and L_XTND are
  1075.    not defined.  O_RDONLY is in fcntl.h (actually <sys/fcntl.h>, but
  1076.    fcntl.h includes this.)  L_XTND can be replaced by SEEK_END.
  1077.    SEEK_END is in stdio.h.  These two fixes will allow motifshell to build.
  1078.    Note: many MANY compiler warning messages will be generated during
  1079.    the build process.
  1080.  
  1081. 6) You can go to the demos/xmsamplers directory and do a make there.
  1082.    Other demos may build, or not depending on whatever. . . .
  1083.  
  1084. 7) make install will do the install.  [It will fail at motifshell
  1085.    if you don't fix it, as mentioned above.]  You can do a make install
  1086.    in demos/xmsamplers if you want these.
  1087.  
  1088. 8) If running on a SUN (as opposed to an X term), you will (probably) need
  1089.    to start openwin with something like:
  1090.  
  1091.         openwin -server /usr/X11R5/bin/Xsun
  1092.  
  1093.  
  1094.    [You might want to use an alias for this.]
  1095.    This fixes an annoying problem: The mouse keys stop working after you
  1096.    click on an icon to get the icon menu (on SUNs only, not X terms).
  1097.    The ALT keys still work, if you get stuck.  I don't know whether this
  1098.    is a bug in SUN's server or whether it is Motif related.
  1099.  
  1100.    Here is a copy of my .xinitrc:  It's not elegant.  Sun's default
  1101.    openwin startup file is in: /usr/openwin/lib/Xinitrc.  You can
  1102.    copy this to ~/.xinitrc and customize as desired.  Obviously, the
  1103.    default behavior is to start the OpenLook environment (boo!).
  1104.  
  1105.  
  1106. #!/bin/sh
  1107. #
  1108. # .xinitrc - OpenWindows startup script.
  1109. #
  1110. if [ -f $HOME/.Xdefaults ]; then
  1111.     xrdb $HOME/.Xdefaults              # Load Users X11 resource database
  1112. fi
  1113. if [ -f $HOME/.Xdefaults.sun ]; then
  1114.     xrdb -merge $HOME/.Xdefaults.sun
  1115. fi
  1116. DISPLAY=`hostname`:0.0
  1117. export DISPLAY
  1118. xhost + > /dev/null
  1119. #xterm -sb -sl 512 -T `hostname` -ls -n `hostname` &
  1120. xterm -sb -sl 512 -T `hostname` -n `hostname` &
  1121. mwm &
  1122. xclock -geometry +1010+0 &
  1123. xload -geometry +710+5 -fg red &
  1124. xsetroot -solid salmon &
  1125. xterm -sb -sl 100 -T CONSOLE_DO_NOT_LOGOUT -C -n console -iconic
  1126. #wait
  1127.  
  1128. Here's .Xdefaults.sun, which gives me a more readable font for use with
  1129. motif on Sun monitors:
  1130.  
  1131. !Some additional .Xdefaults values specifically for SUN
  1132. !
  1133. ! After loading .Xdefaults, xrdb -merge .Xdefaults.sun
  1134. !
  1135. Mwm*fontList:           8x16
  1136. !Mwm*fontList:          vtbold
  1137. !Change as desired.
  1138.  
  1139.  
  1140.      You will probably want to maintain LD_LIBRARY_PATH to something like:
  1141. /opt/SUNWspro/lib:/usr/ccs/lib:/usr/ucblib:/usr/X11R5/lib:/usr/lib:
  1142. /usr/openwin/lib.  If you use emacs, you will need to leave /usr/openwin/lib
  1143. there.  [This is because you probably, like me, used the distributed version
  1144. of s-sol2.h, which explicitly refers to windowing libraries as being in the
  1145. /usr/openwin locations.  Yes, I know that emacs/Solaris ought to allow
  1146. LibXt.so.N.M to be "picked up" from elsewhere, like /usr/X11R5/lib, but the
  1147. one emacs links with is LibXt.so.4.something, and the mit one is
  1148. LibXt.so.5.something.  So it seems to want the .4 one.  Any comments?  I'd
  1149. prefer not to rebuild emacs based on the X11R5 libs because I occassionally
  1150. need to move the emacs binaries to machines without the mit files.]
  1151.  
  1152. -----------------------------------------------------------------------------
  1153. Subject: 115)  What compile errors/warnings might I get in both Sun 3 and Sun
  1154. 4?
  1155.  
  1156. Answer:
  1157.  
  1158.  
  1159. make: Warning: Too many rules defined for target
  1160. make: Warning: Too many rules defined for target
  1161. "callbacks.c", line 1530: warning: illegal combination of pointer
  1162. and integer, op =
  1163. "callbacks.c", line 1531: warning: illegal combination of pointer
  1164. and integer, op =
  1165. "callbacks.c", line 1532: warning: illegal combination of pointer
  1166. and integer, op =
  1167. "utils.c", line 73: warning: illegal combination of pointer and integer, op =
  1168. "utils.c", line 74: warning: illegal combination of pointer and integer, op =
  1169. "utils.c", line 122: warning: illegal combination of pointer and integer, op =
  1170. "utils.c", line 123: warning: illegal combination of pointer and integer, op =
  1171. "utils.c", line 191: warning: illegal combination of pointer and integer, op =
  1172. "utils.c", line 194: warning: illegal combination of pointer and integer, op =
  1173. "utils.c", line 195: warning: illegal combination of pointer and integer, op =
  1174. "utils.c", line 196: warning: illegal combination of pointer and integer, op =
  1175. "utils.c", line 316: warning: illegal combination of pointer and integer, op =
  1176. "utils.c", line 334: warning: illegal combination of pointer and integer, op =
  1177. "utils.c", line 338: warning: illegal combination of pointer and integer, op =
  1178. "utils.c", line 341: warning: illegal combination of pointer and integer, op =
  1179. "xmdialogs.c", line 838: warning: illegal combination of pointer
  1180. and integer, op =
  1181. "xmeditor.c", line 1152: warning: illegal combination of pointer
  1182. and integer, op =
  1183.  
  1184. These warning messages can be ignored. OSF is aware of these warnings.
  1185.  
  1186.  
  1187. -----------------------------------------------------------------------------
  1188. Subject: 116)  On a Sun 3, what are the mwm startup error messages about?  I
  1189. get
  1190.  
  1191. mwm: Invalid accelerator specification on line 7 of
  1192.      specification string
  1193. mwm: Invalid accelerator specification on line 31 of
  1194.       configuration file
  1195.  
  1196.  
  1197. Answer: This is because some Sun keyboards do not have an F10 key and some sun
  1198. workstations which have an F10 key do not have X-servers which recognize it.
  1199. The F10 key is used by mwm.  If the machine does have an F10 key, the user
  1200. should use xmodmap to tell the server it exists.  Otherwise, change the
  1201. definition of the DefaultWindowMenu in /usr/lib/X11/system.mwmrc (after
  1202. installation) or in /lib/clients/mwm/system.mwmrc (before installation).
  1203. Change the accelerator of "Maximize" (it is "Alt<Key>F10)" to something else.
  1204. Also, you should change the definition of DEFAULTSYSTEMMENU in the file
  1205. /clients/mwm/WmResource.c in a similar fashion.  There is as yet no standard
  1206. redefinition for F10.
  1207.  
  1208.  
  1209.  
  1210. -----------------------------------------------------------------------------
  1211. Subject: 117)  Are there problems making shared libraries on a Sun?
  1212.  
  1213. Answer: If you use the -pic option you may run out of offset table space.  use
  1214. the -PIC option instead.
  1215.  
  1216. You may get the message "ld.so: Undefined symbol: __XtInherit" when executing
  1217. UIL. There is a problem in shared library build when you compare a function
  1218. variable to a routine name, but don't call the routine.  Either, you can build
  1219. the Xt library nonshared, or you can put a reference to XtToolkitInitialize in
  1220. the UIL main program (or even include a module that references it).  The
  1221. routine doesn't even have to be called; it just has to be there.
  1222.  
  1223.  
  1224. -----------------------------------------------------------------------------
  1225. Subject: 118)  The OpenWindows server hangs when I popup a menu with Button 3.
  1226. [Last modified: August 92]
  1227.  
  1228. Answer: This is an OpenWindows problem, but if you have Motif source you can
  1229. fix your own applications. From Steve Sistare of Thinking Machines Corp.:
  1230. "Change the 2 calls to XtGrabButton in RowColumn.c such that ButtonReleaseMask
  1231. | ButtonPressMask is passed for the event mask.  Currently, only
  1232. ButtonReleaseMask is passed.  Also, change the owner_event argument to FALSE.
  1233. " This has not been fixed in Motif as at 1.1.5.
  1234.  
  1235. -----------------------------------------------------------------------------
  1236. Subject: 119)  Has anyone made shared libraries on an IBM RS/6000?
  1237.  
  1238. Answer: From Sakari Jalovaara: There is a problem: Xm redefines VendorShell
  1239. and the AIX linker put _both_ Xm's and Xt's VendorShell into programs.  When
  1240. an AIX shared library is created as many references inside the library are
  1241. resolved as possible.  If the symbol vendorShellClassRec is defined in libXt
  1242. and referenced, say, from a function XtFoo() also in libXt, the "ld" run that
  1243. creates the shared library resolves the reference:
  1244.  
  1245.         XtFoo() -> vendorShellClassRec
  1246.  
  1247. Then I create the Motif library that has its own vendorShellClassRec and an
  1248. XmBar() function that uses it; libXm will also contain a resolved reference to
  1249. vendorShellClassRec:
  1250.  
  1251.         XmBar() -> vendorShellClassRec
  1252.  
  1253. Finally, I link a program that uses both XtFoo() and XmBar() and the program
  1254. will end up with _two_ independent "vendorShellClassRec"s:
  1255.  
  1256.         XtFoo() -> vendorShellClassRec [Xt version]
  1257.         XmBar() -> vendorShellClassRec [Xm version]
  1258.  
  1259. Instant schizo zaphod mode.  In reality, vendorShellClassRec is not referenced
  1260. from functions but from other widget class records.
  1261.  
  1262. I can't just pull Vendor.o out from the shared Xt (Vendor.o appears to define
  1263. the only external symbols redefined by libXm) because AIX shared libraries
  1264. apparently can't contain unresolved external references.  If I take out
  1265. Vendor.o I have to take out every other file that uses symbols defined there -
  1266. and then files that need those files, etc.  I tried it and ended up with three
  1267. or four object files in libXt and the res non-sharable.
  1268.  
  1269. I kludged around this by putting all of libXt (minus Vendor.o) into the shared
  1270. libXm.  It isn't a pretty solution but it works - and beats having a
  1271. statically linked two-megabyte "periodic" demo...
  1272.  
  1273.  
  1274. -----------------------------------------------------------------------------
  1275. Subject: 120)  What is the error  "Unaligned access in XmString" under Ultrix?
  1276.  
  1277. Answer: Compile  XmString.c with STRINGS_ALIGNED.
  1278.  
  1279. -----------------------------------------------------------------------------
  1280. Subject: 121)  TOPIC: KEYSYMS
  1281.  
  1282. -----------------------------------------------------------------------------
  1283. Subject: 122)  What is causing the messages "unknown keysym osfDown..."?  It
  1284. happens when I run an application under Motif 1.1
  1285.  
  1286. Answer: There is an OSF supplied addition to the /usr/lib/X11/XKeysymDB file.
  1287. It is found on the release tape and should have been automatically installed
  1288. if the installation procedure was followed in the Release Notes.
  1289.  
  1290. You have to copy (or append) lib/Xm/XKeysymDB into /usr/lib/X11.  This may
  1291. require root permission.  It is not clear how to fix the problem if you can't
  1292. do this.  The error comes from Xt translation table parsing and can't be fixed
  1293. in Motif, so if you can't get root permission you may be stuck.  The file is
  1294. not copyrighted so you can install it on other systems.
  1295.  
  1296. If X has been built so that XKeysymDB is not in this directory, and you don't
  1297. know where it is looking, run 'strings libX11.a | grep XKeysymDB' to find the
  1298. path.
  1299.  
  1300. On a Sun running openwin with shared libraries, you may need to put the path
  1301. for the library containing XKeysymDB *first* in the path list in
  1302. LD_LIBRARY_PATH, or it may find the wrong XKeysymDB in the wrong directory.
  1303.  
  1304. XKeysymDB simply contains the registered keysym values for the OSF keysyms.
  1305. The OSF values are server-independent.  And, all registered keysyms will be
  1306. included in an XKeysymDB file to be shipped with X11R5.
  1307.  
  1308. In the meantime (till all systems are X11R5+), a list of the registered
  1309. keysyms can be found in the X11R4 release in mit/doc/Registry/Xregistry.
  1310.  
  1311. Also note the XKEYSYMDB environment variable. Setting this to point to the
  1312. XKeysymDB file often helps, but not always...
  1313.  
  1314.  
  1315. -----------------------------------------------------------------------------
  1316. Subject: 123)  What happens if I can't install Motif Keysyms?
  1317.  
  1318. From: tessi!george@nosun.West.Sun.COM (George Mitchell)
  1319.  
  1320. Here's what appears to happen if you don't have XKeysymDB in place to define
  1321. OSF's virtual keysyms:
  1322.  
  1323. 1. At class initialize time, for a widget (such as XmText) that uses virtual
  1324. keysyms in its event translation table, all entries which refer to those
  1325. keysyms fail to parse correctly.  In the case of XmText, instead of ending up
  1326. with a translation table with roughly 90 entries, you end up with one that has
  1327. 29.
  1328.  
  1329. 2. XKeysymDB doesn't exist, so you'd assume that KeyPress events will get
  1330. translated to plain vanilla keysyms, right?  WRONG!  All Motif widgets install
  1331. a virtual keysym translator ANYWAY!  Consequently, the backspace key (for
  1332. example) gets translated to the keysym osfBackSpace.
  1333.  
  1334. 3. Therefore, if you augment or override your widget's translations with
  1335. translations that refer to plain vanilla BackSpace, they will never be
  1336. triggered, because you will NEVER see plain vanilla BackSpace, only
  1337. osfBackSpace.
  1338.  
  1339. 4. But you can't use osfBackSpace in an event translation entry, because you
  1340. don't have XKeysymDB installed!
  1341.  
  1342. Here's how I'm "dealing" with the problem right now: Motif installs its
  1343. virtual keysym translator by calling XtSetKeyTranslator every time a
  1344. VendorShell (or subclass) widget is created.  So every time I create a shell,
  1345. I immediately call XtSetKeyTranslator (display, XtTranslateKey) to restore the
  1346. default translator.  No more funny virtual keysyms!  Now I can reinstall non-
  1347. osfKeySym translations and have them work the way I expect.
  1348.  
  1349.  
  1350. -----------------------------------------------------------------------------
  1351. Subject: 124)  Why has OSF introduced Keysyms into Motif 1.1?  They weren't
  1352. there in Motif 1.0.
  1353.  
  1354. Answer: From: ellis@osf.org
  1355.  
  1356. Virtual Keysyms are meant to provide a consistent keyboard model for Motif
  1357. applications running in a heterogeneous environment in which proprietary (i.e.
  1358. vendor specific) non-Motif applications may also be running.
  1359.  
  1360. First of all, for the sake of the rest of the readers, let's explain why this
  1361. is an issue:
  1362.  
  1363. It would be lovely if Motif's translation tables could just use the obvious
  1364. keysyms predefined by X.  For example, there are keysyms for XK_BackSpace,
  1365. XK_Delete, XK_Left, XK_Right, etc.  Shouldn't these be the ones that are used
  1366. in our translations?  Unfortunately, the problem is not so simple.  Some
  1367. specific examples:
  1368.  
  1369.    While most vendors bind XK_BackSpace to the key at the top right
  1370.    of the standard keyboard (often engraved with a leftwards
  1371.    pointing arrow), not all do.  In fact, some vendors (including DEC)
  1372.    bind that key to XK_Delete.
  1373.  
  1374.    While most vendors bind the arrow keys to XK_Up, etc, a number of
  1375.    vendors (including Sun, on some servers) bind them to function key
  1376.    keysyms.
  1377.  
  1378. A simplistic solution would require the use of xmodmap to change the offending
  1379. bindings.  That would work swell in an all Motif environment.  However, OSF's
  1380. goal (not always perfectly achieved) is interoperability.  That is, we'd like
  1381. to make sure that both Motif and non-Motif programs can happily run in the
  1382. same environment.
  1383.  
  1384. It is expected that a vendor may have a wide variety of existing X-based
  1385. software that uses the keysyms as established by that vendor for specific
  1386. purposes.  It is expected that these applications may run at the same time as
  1387. Motif-based software.  Using xmodmap to change keysyms on the server side
  1388. could "break" the existing applications (or at the very least their
  1389. documentation) by making some keys unavailable, or by moving the location.
  1390.  
  1391. So, we chose not to use xmodmap.  By the way, though OpenLook uses a different
  1392. implementation (they recompile their virtual translation tables into actual
  1393. translation tables), they basically adopted the same approach, presumably for
  1394. similar reasons.
  1395.  
  1396. To work properly, the virtual keysym model we implemented depends on Xlib
  1397. finding XKeysymDB installed appropriately (which standard Motif installation
  1398. does).  This simply defines the keysyms (not the key they are bound to).  This
  1399. unfortunate piece of stupidity is necessary because MIT only includes standard
  1400. keysyms in keysymdef.h.  It should be said that our lives would be made easier
  1401. if MIT would also see fit to include registered keysyms in keysymdef.h as
  1402. well.
  1403.  
  1404. Motif applications determine how to bind virtual to actual keys by looking for
  1405. either a resource or a property on the root window which describes what to do.
  1406. Note that this information is on the server side, so that all applications use
  1407. the same virtual bindings regardless of where they are running.  Mwm will
  1408. happily create the property if it finds a .motifbind file in your home
  1409. directory when it starts up.  (Actually, things generally work even if none of
  1410. this is done, since if all else fails, the Motif toolkit chooses a virtual
  1411. bindings table to use based on the identification of the server).
  1412.  
  1413. The actual implementation of virtual keys is made possible by a hook in the
  1414. Intrinsics.  Undoubtably, the implementation would be simpler and cleaner if
  1415. virtual key support was more directly supported by the Intrinsics.  We will be
  1416. exploring this possibility in the future.
  1417.  
  1418.   -- Ellis
  1419.  
  1420. -----------------------------------------------------------------------------
  1421. END OF PART FOUR
  1422. -- 
  1423. ..........................
  1424.  
  1425.