From: ksall@cen.com (Ken Sall)
Newsgroups: comp.windows.x.motif,comp.answers,news.answers
Subject: Motif FAQ (Part 7 of 9)
Date: 7 May 1995 12:28:50 GMT
Organization: none
Approved: news-answers-request@MIT.EDU
Expires: 20 Jun 1995 12:27:35 GMT
Message-ID: <motif-faq/part7_799849655@rtfm.mit.edu>
Reply-To: ksall@cen.com (Ken Sall)
Keywords: FAQ question answer

Archive-name: motif-faq/part7
Last-modified: MAY 05, 1995
Posting-Frequency: monthly
Organization: Century Computing, Inc. <URL:http://www.cen.com/>
Version: 4.4




-----------------------------------------------------------------------------
Subject: 168)  Is there an Ada binding for Motif? (Part 1 of 2)

[Last modified: Apr 94 ]

Answer: Answer:  Integrated Computer Solutions, Inc. (ICS) supplies Ada
bindings to Motif for a number of platforms and Ada compilers.  ICS also
provides Builder Xcessory, a Motif interface builder, which outputs Ada code
usable with the Ada bindings.  The product family is known collectively as the
Ada Xcessories.

Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
USA info@ics.com   617/621-0060


Information on Ada bindings to Motif and other services (such as SQL and
POSIX) can be found in a document maintained by the Ada Information
Clearinghouse.  The report can be found at

        host:   ajpo.sei.cmu.edu
        loc:    /public/ada-info/bindings.hlp.*
        access: anonymous ftp

The suffix to the file (indicated above with an asterix) is the date of the
latest update to the document.  For example, the full name of the report
updated on 14 June 1993 would be

        /public/ada-info/bindings.hlp.14Jun93.

The file is ASCII.

------ Included File


[...Excerpted from the AdaIC report bindings.hlp.14Jun93...]
[...Updates can be found on ajpo.sei.cmu.edu, in the    ...]
[...file /public/ada-info/bindings.hlp.*  The suffix    ...]
[...is always the date of the lastest version to the    ...]
[...report.                                             ...]

                                     SECTION 12
                                  X-Window System:
                               OSF Motif and Open Look
                               Available Ada Bindings


12.1  Description and Standardization Efforts

The X-Window System is a network-transparent window system.  It supports one
or more screens containing overlapping windows or subwindows.  X display
servers distribute user input to and accept output requests from various
client programs located either on the same machine or elsewhere in the
network.

            OSF Motif (Open Software Foundation/Motif) is a graphical user
            interface from OSF that provides a Presentation Manager look and
            feel for applications running on any system with X Window version
            11.  It conforms to POSIX, ANSI C and X/Open's XPG3 standards.

12.2  Resources Available from Software Reuse Libraries/Repositories


ASSET                                               (Updated:  November 1992)

The following information was taken in its entirety from the ASSET Library
Repository Catalog, October 9, 1992.  For more information on ASSET, see
Appendix C.


INTERFACE TO THE X WINDOW SYSTEM

VERSION_NUMBER    : 1.1
DEVELOPED_BY      : SAIC
RELEASE_DATE      : 29-SEP-88
UNIQUE_IDENTIFIER : ASSET_A_240
ALTERNATE_NAME    : SAICX2
ASSET_TYPE        : SOFTWARE CODE
FUNCTIONS         : INTERFACE, BIND
OBJECTS           : ADA, X WINDOWS
KEYWORDS          : STANDARDS, BINDINGS
COLLECTION        : STARS FOUNDATIONS
DISTRIBUTION      : UNLIMITED

DESCRIPTION       :

Interface to the X Window System
      An expression of the various concepts in Ada that provides a full,
working Ada specification of the X Window system.
     Approved for public release; distribution is unlimited.

12.3  Products Available from Vendors


Advanced Technology Center                           (Updated:  November 1992)

The Advanced Technology Center (ATC) has an Ada binding to OSF Motif for their
AXI~ product.  AXI is currently available for most UNIX-based platforms, and
is supported by Verdix, Meridian, and TeleSoft compilers.

AXI is an Ada-to-X-Window System interface that provides the Ada programmer
access to the 500+ functions, libraries, and procedures contained in the X
library (Xlib), the X Toolkit (Xt), the X Extensible Library, the X
Miscellaneous Utilities, the Motif widget set and the Motif Resource Manager.

ATC is planning to develop an Ada binding to Open Look for AXI.

For more information, contact:Larry Paulson, Advanced Technology Center, 22982
                        Mill Creek Drive, Laguna Hills, CA  92653, USA; Phone:
                        714-583-9119


Alsys, Inc.                                            (Updated:  May 1992)

The Alsys Ada Software Development Environment (Alsys's validated Ada compiler
#901221W1.11103) for 386 UNIX is a production-quality Ada environment capable
of handling very large Ada applications (over 500,000 lines of code).  The
product includes the Compiler; Multi-Library Environment, which provides a
powerful and flexible way to manage Ada development effort and share program
units; Binder, which supports unused subprograms elimination; High-and Low-
Level Optimizers for improving code quality and performance; and Run-Time
Executive for efficient support for executing Ada programs.  Also included is
the Developer's Toolset including:  Ada Probe, a symbolic source level
debugger and program viewer; AdaXref, a cross-reference generator; AdaMake, a
recompilation aid; AdaReformat, a source reformatter.

Alsys currently has Ada bindings to POSIX, X-Windows (OSF Motif), and the
Generic Package of Elementary Functions for the Alsys Ada Software Development
Environment, running on 386 UNIX 386/486-based machines supported as both host
and target and running 386/ix or SCO UNIX.  They are also planning a binding
to SQL for  386/486 machines.

Host/Target:386/486 PC under IX UNIX, 386/486 PC under SCO UNIX

The Alsys Ada Software Development Environment for the IBM RS/6000 is a
production-quality Ada environment capable of handling very large Ada
applications.  Hosted on and targeted to the IBM RS/6000 workstation under
IBM's AIX operating system, the product includes the Compiler; Multi-Library
Environment, which provides a  powerful and flexible way to manage Ada
development efforts and share program units; Binder; Run-Time Executive; and
both a High and Low-Level Optimizer for improving code quality and
performance.  Also included is the Alsys Ada Toolset including Ada Probe,
symbolic source level debugger and program viewer; AdaXref, cross-reference
generator; AdaMake, recompilation aid; and AdaReformat, source reformatter.

Alsys has bindings currently available to the Generic Package of Elementary
Functions and to X-Windows (OSF Motif) for the Alsys Ada Development
Environment for the IBM RS/6000 running on any RISC System/6000 machine as
both host and target and running IBM's AIX operating system (Alsys's validated
Ada compiler #910809W1.11195).   Alsys also plans to develop a POSIX binding
for the RS/6000.

Host/Target:RISC System/6000 under AIX

The Alsys Ada Software Development Environment for SPARC Workstations is a
production-quality Ada environment capable of handling very large Ada
applications.  Hosted on any SPARC-based workstation under SunOS or SunView,
the product helps you realize the full potential of Ada on SPARC machines. The
product includes the Compiler (with High- and Low-Level Optimizers); Binder,
which supports unused subprogram elimination; Multi-Library system (Family,
Library, and Unit Managers) which provides a powerful and flexible way to
manage Ada development efforts and share program units;  AdaExec real-time
executive, for complete and efficient support for executing Ada programs; and
ISO-standard mathematical library.  Also included is the Alsys Ada Toolset
including AdaProbe, symbolic source level debugger and program viewer;
AdaXref, cross-reference  generator; AdaMake, recompilation aid; and
AdaReformat, source reformatter.

Bindings to the Generic Package of Elementary Functions and to OSF/Motif are
currently available for the Alsys Ada Software Development Environment running
on any SPARC-based Workstation as both host and target and running SunOS or
SunView.

Host/Target:SPARC under SUNOS

For more information, contact:Scott Garren, Alsys, Inc., 67 South Bedford
                        Street, Burlington, MA  01803-5152, USA;  Phone:
                        (617) 270-0030


Digital Equipment Corporation                       (Updated:  November 1992)

Digital Equipment Corporation has bindings available for GKS, PHIGS, SQL, and
OSF Motif for VAX Ada/VMS.  The Ada bindings are provided either as part of a
compiler product or the services/facilities that are provided by Digital and
its suppliers.

Host/Target:DEC VAX under VMS

For more information, contact:Mary Anne Cacciola, Digital Equipment
                        Corporation, 110 Spit Brook Road, Nashua, NH  03062,
                        USA; Phone:  (603) 881-1028


IBM                                              (Updated:  November 1992)

IBM's AIX Ada/6000 product provides a binding to GPEF and IBM AIXWindows (X-
Windows ... not Motif).  It runs on all models of the IBM RISC System/6000
under the IBM AIX Version 3.2 operating system. See also entries for Systems
Engineering Research Corporation (SERC) and Advanced Technology Center (ATC)
for Motif, GKS or PHIGS bindings for use with IBM AIX Ada/6000 products.


The AIX Ada/6000 licensed programs (5706-291 and 5706-294) consist of an
optimizing compiler, a run-time environment, a symbolic debugger, an Ada
"makefile" generator for use in automating and minimizing recompilation, Ada
library management tools and Ada language bindings to some key AIX subsystems.
With the exception of some system-specific aspects of the language, the Ada
language for the AIX operating system is source compatible with the Ada
language supported by IBM licensed programs in VM/CMS and MVS.

Host/Target:IBM RISC System/6000 under the IBM AIX Version 3.2 operating
            system

This product conforms to the following standards:  ANSI/MIL-STD-1815A - Ada at
current level (1.11) of the ACVC test suite.

For more information, contact:Barry Lee, IBM Corporation, 844 Don Mills Road,
                        North York, Ontario, Canada  M3C 1V7; Phone:  (416)
                        448-3174; Fax: (416) 448-4810

Objective Interface Systems, Inc.                  (Updated:  November 1992)

Objective Interface Systems, Inc., has an Ada binding to X-windows (OSF Motif)
for its Screen Machine~ product.  The Screen Machine binding to Motif includes
a WYSIWYG drawing tool and an Ada code generator.

Host/Target:

      Sun SPARC/SunOS         Rational R1000/Delta    HP 9000/7XX; 8X7
      IBM RISC System/6000/AIXPC 386/486/ISC UNIX     HFSI WIS Workstation
      PC 286/386/486/MS-DOS   PC 386/486/SCO UNIX     DEC Ultrix; DEC VMS

For more information, contact:Phil Carrasco, Object Interface Systems, Inc.
                        1895 Preston White Drive, Suite 250, Reston, VA
                        22091-5448, USA; Phone: (703) 264-1900; Fax:
                        703-264-1721; email info@ois.com (internet)


SL Corporation                                     (Updated: November 1992)

SL Corporation's SL-GMS toolkit includes Ada bindings to GPEF, GPPF, POSIX,
SQL, TCP/IP, OSF/Motif, and Open Look.

SL-GMS is a toolkit for developing dynamic graphics screens for real-time or
highly interactive applications.  Non-programmers can design application
screens in a standard drawing-tool mode, connect them to real-time data
sources and animate screen objects to visualize changing data values.  SL-GMS
allows the design of custom "GISMOs" to input values or control the
application and supports MOTIF, OPEN LOOK and other X toolkit widgets.

SL-GMS is used extensively to provide real-time graphics for applications in
the fields of manufacturing, process control, network management, avionics and
financial tracking.

Host/Target:Validated Verdix and DEC compilers support SL-GMS for the
            following machines as both host and target:


      DEC-DECstation/ULTRIX 4.0DEC-VAXstation/ULTRIX 4.0
      DEC-VAXstation/VMS 5.4  DEC-VAXstation/VMS 5.5

      IBM-RS6000/AIX

      HP-9000/300/UNIX        HP-9000/400/UNIX
      HP-9000/800/UNIX        HP-9000/700/UNIX

      PC-386/IX UNIX          PC-386/SCO UNIX
      PC-386/Lynx             PC-386/0S2
      PC-386/System 5.4

      SGI-4D/IRIX 3.3

      Sun-3/SunOS 4.1         SunSPARC/SunOS 4.1

      88 Open/BCS Compliant

For more information, contact: Mike Meagher, SL Corporation, 240 Tamal Vista
                        Boulevard, Corte Madera, CA  94926, USA Phone: (415)
                        927-1724; Fax: (415) 927-2931


Sunrise Software International                         (Updated:  May 1992)

Sunrise Software International's product, ezx, is a rapid application
development tool that automates the creation of graphical user interfaces for
OSF/MOTIF and generates C, UIL, or Ada.  ezx provides WYSIWYG screen layout;
color, font and pixmap editors; presentation tools and dialog management.  A
prototype can be developed in hours and using a script language similar to
Hypertalk, demonstrated to end-users before the first line of code is written.
Then portable C, UIL or Ada can be generated automatically.  Ada bindings are
provided.  The total code required to develop a GUI is reduced by
approximately 75%.   The appearance and behavior of the GUI is defined in an X
resource file which the application loads at run time.  This provides explicit
separation between the GUI and the computational core of the application. Thus
the GUI can be revised without recompiling (and retesting) the application.

ezx provides cost savings throughout the software development cycle, from
requirements analysis through design, code, test and maintenance.


Host/Target:DEC RISC under ULTRIX, DEC VAX under VMS, IBM 386 under UNIX, IBM
            RS 6000 under AIX, SGI under, SUN SPARC under UNIX

For more information, contact:Frederick Sells, Sunrise Software International,
                        170 Enterprise Center, Middletown, RI  02840, USA;
                        Phone:  401-847-7868

Systems Engineering Research Corporation (SERC)     (Updated:  November 1992)

-----------------------------------------------------------------------------
Subject: 169)  Is there an Ada binding for Motif? (Part 2 of 2)

[Last modified: Apr 94 ]

Answer: (This answer hasn't changed since the date given, but I needed to
break it into 2 parts.)

SERC's Ada/MOTIF is a complete binding to X Window and OSF/Motif for the Ada
programming language that was based in part upon the SAIC/Unisys (STARS)
public domain bindings.  That work was leveraged as a starting point for this
development; many of the bug fixes and additional capabilities beyond the
public domain releases in Ada/MOTIF have been incorporated.  Most noteworthy
are the capabilities included in Ada/Motif for Ada tasking, callback
registration, memory leak detection/prevention and capabilities for developing
customized widgets.  Paramax/STARS considers Ada/Motif to be the commercial
version of their STARS bindings, according to SERC.

Ada/MOTIF is supported by the ALSYS, VERDIX, SUNAda, IBM Ada, and SGI Ada
compilers.


Host/Target:SUN 4, HP 300/400, HP 700, IBM RS 6000, SGI, 386
            SUN OS 4.1.1, SOLARIS 2.0 (coming), HPUX 8.0, SGI 3.2 & 4.0, IBM
            ATX 3.2, SCO 3.2

For more information, contact:

        Theo Kusiolek or Scott Cleveland, Systems
        Engineering Research Corporation (SERC), 2555
        Charleston Road, Mountain View, CA  94043, USA;
        Phone:  800-ADA-SERC or 415/962-9092; Fax:  415/962-0330;
        E-mail:  Well!sercmail@apple.com.


TeleSoft                                            (Updated:  November 1992)

TeleSoft's TeleUSE/Ada automates the creation of OSF/Motif graphical user
interfaces for Ada applications.  It includes a special version of the TeleUse
User Interface Management System -- which generates Ada source code -- and Ada
bindings to the TeleUSE run-time routines.

TeleUse/Ada tools allow a GUI to be prototyped and designed using a WYSIWYG
editor and a PDL, and also includes tools for debugging, generating production
code and maintaining the GUI.  TeleUse/Ada can save the developer up to 90
percent of the time required to hand code X Window System GUIs.

Host/Target:SPARC under UNIX, Sun-4 under UNIX


TeleSoft's TeleWindows is a set of Ada bindings to the X Window System and
OSF/Motif.  This includes Xlib, XT, X extensions Library, XT+, X miscellaneous
utilities, Motif widget set, XM, MWM, Motif resource manager.  It supports X-
11 R4 and is not based on the public domain version.  It closely follows the C
Xlib syntax and allows Ada applications to co-exist with C applications.

Host/Target:IBM System/370 under VM/CMS

For more information, contact:Karen Johnson, TeleSoft, 5959 Cornerstone Court
                        West, San Diego, CA  92121-9891, USA; Phone:  (619)
                        457-2700

Verdix                                              (Updated:  May 1992)

The Verdix Ada Development System (VADS), is a complete Ada Compiler System
offering a fully validated Ada compiler with chapter 13 support.  Verdix
supplies VADSself and VADScross.   VADSself provides a complete toolset for
self-targeted applications.  It easily interfaces to databases, windowing
systems and program management tools.  VADScross provides real-time support
for host-to-target system development.  VADScross produces small and fast
object code.  VADS is hosted on the largest number of platforms and targets
the greatest number of microprocessors.

Host/Target:88000 BCS under UNIX, DEC VAX under VMS / ULTRIX / UNIX,
            DECStation (RISC) under UNIX, DECSystem (RISC) under UNIX, HP 9000
            Series 300 under HP-UX  (UNIX), IBM PS/2 under AIX  (UNIX), IBM
            RISC System/6000 under AIX, SCO Systems V/386 (ABI) under UNIX,
            Sun SPARC systems under UNIX, Sun-3 systems under UNIX

Verdix AXI provides an Ada binding to the full Motif, Xt, and Xlib libraries.
The product works with user-supplied Motif 1.1 and X11R4 libraries regardless
of source.

Host/Target:DEC RISC under Ultrix, IBM RS6000 under AIX, MIPS under MIPSos,
            Sun-4 under SunOS, Sys V386 under ISC UNIX, Sys V386 under SCO
            UNIX

For more information, contact:Tim Ruhe, Verdix Corporation, 205 Van Buren,
                        Herndon, VA  22070, USA; Phone:  (703) 318-5800

Answer: Integrated Computer Solutions, Inc. (ICS) supplies Ada bindings to
Motif for a number of platforms and Ada compilers.  ICS also provides Builder
Xcessory, a Motif interface builder, which outputs Ada code usable with the
Ada bindings.  The product family is known collectively as the Ada Xcessories.

Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
USA info@ics.com   617/621-0060

-----------------------------------------------------------------------------
Subject: 170)  Is there a Poplog binding for Motif?

[Last modified: May 93]

Answer:
 A integrated programming environment consisting of the programming
    languages Pop-11, Prolog, Standard ML, and Lisp which are compiled
    to machine code via a common virtual machine. Pop-11 provides a rich
    interface to the X Toolkit which can be accessed from all other
    Poplog languages. The OLIT, Motif, and Athena widget sets are
    supported, in addition to the custom Poplog (Xpw) widget set. XVed
    provides a sophisticated, customisable multi-window editor. Under
    OPEN LOOK and Motif the Poplog User Interface (PUI) provides a
    graphical interface to the Poplog system. High-level Pop-11
    libraries allow graph drawing, turtle graphics, and the simple
    creation of basic button/menu based interfaces.

Contact:

    UK EDUCATION SITES:
        Poplog Sales. School of Cognitive and Computing Sciences.
        Brighton. BN1 9QN. England.
        Phone: +44 (0)273 678188
        Email: popsales@cogs.susx.ac.uk
    USA AND CANADIAN EDUCATION SITES:
        Computable Functions Inc. 35 South Orchard Drive. Amherst.
        MA 01002. USA.
        Phone: (413) 253-7637
    ALL OTHER SALES:
        Integral Solutions Ltd. Unit 3, Campbell Court. Bramley.
        Basingstoke. Hampshire. RG26 5EG. England.
        Phone:  +44 (0)256 882028
        Fax:    +44 (0)256 882182
        Email:  isl@integ.uucp


-----------------------------------------------------------------------------
Subject: 171)  TOPIC: SPECIFIC PLATFORMS

-----------------------------------------------------------------------------
Subject: 172)  Is it easy to build Motif for a Sun?

Answer: See next question for Solaris 2.  No pattern has emerged to problems
about compiling Motif on the Sun (although people seem to have a lot of
different minor problems), and many reports are that it is straightforward.
Read the Motif install instructions (which often have specific reference to
Sun installation), light the blue touch paper and just standback. [My
experience was that I had to add -D_NO_PROTO for 1.1 on a Sparc OS 4.1, and
that was all.  Others have added STRINGS_ALIGNED and NO_REGEXP].


-----------------------------------------------------------------------------
Subject: 173)  How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?

[Last modified: Oct 94]

Prepared by Ric Steinberger.  ric@updike.sri.com  4/09/93

What follows is a description of the steps I used to build Motif 1.2.2 on a
SUN IPX running Solaris 2.1.  Sun's C compiler (2.0.1) was used.  Many thanks
go to Kaleb Keithley (kaleb@devvax.jpl.nasa.gov) for several useful
suggestions.  Other people, including OSF staff, especially David Brooks
(dbrooks@osf.org), helped as well.  My thanks to you all.

1. Build X11R5 from the mit distribution.  You need to retrieve the sources
   from ftp.x.org (in pub/R5) and patches 1 - 22 (or fixes 1-26)
   pub/R5/fixes).  There are several other sites that contain the X11R5
   sources.  After installing patch 19, apply PEXlib.tar.Z, also available
   from ftp.x.org in pub/R5/fixes.  You can apply also
   R5.Xsun.multi-screen and R5.SunOS5.patch.  There are .README files
   that explain how to patch.  Be SURE to read
   R5.SunOS5.patch.README for details on how to BUILD X11.  You probably
   want to use the ProjectRoot feature in the site.def file in the
   mit/config directory.  You will NEED to edit that file to do that.

2. Obtain the Motif 1.2.2 distribution from OSF (617-621-7300).  You may
   need to first install the 1.2 tape, then the 1.2.1 and finally the
   1.2.2 tape.  You might want to do a "chmod -R u+w ." after unloading
   each tape.

3. In the config directory, there are several changes.  Some of the changes
   are based on R5.SunOS5.patch files.  A complete set of config files
   relevant to Solaris have been placed in the anon-ftp account of
   updike.sri.com in pub/motif/solaris21-motif122-config.tar.Z.  They are
   also available from OSF on their mail response server (available to
   support contract holders) and they will send them directly to full
   support contract holders.  Decompress and untar this file in your Motif
   config subdirectory.  Copy site.def.sample to site.def, then edit
   site.def.  You will probably want to uncomment the ProjectRoot section
   and use the same value used in your X11R5 build.  Also, you will probably
   want to use /usr/ucb/install in you installed the UCB compatibility
   suite.  Otherwise you might want to use the install supplied at the end
   of this memo.  [I used the UCB version and can't swear that this works.
   Bit it should.  Put it someplace like /usr/local/bin and chmod +x it.]

   There are two patches to consider.  One fixes a cursor problem
   in ./lib/Xm/TextF.c.  The other removes a Berkeleyism.  These
   patches should probably be consider unofficial at present.
   Failure to deal with the Berkeleyism (bzero) means you will need to
   link with -lucb -lelf.  This will probably work, but why bother?
   Furthermore, if you move the Motif binaries to a machine without
   the ucb compatability suite, you won't have the sharable libs you need.

[The actual patches have been censored because they contain OSF source code]

   Patch 1: In TextF.c there are several places _XmTextFieldDrawInsertionPoint
is called. These should be moved two or three lines further down *after* the
"if (!XtIsRealized(tf)) return True;" statement.


   patch 2: The call to bzero in lib/Xm/Visual.c should be replaced by the
equivalent call to memset


    Both these patches can be applied in the ./lib/Xm directory.
    If you don't have the patch program (how did you build X11?),
    you can get it in the vendor/cygnus directory of ftp.uu.net,
    or you can build it from source.  Be sure to get the latest
    version (2.0.12.u8).

4) Use the README-1.2.1 file as a guideline for building motif.  I followed
   directions in the section called, "Using X11R5 Installed Libraries
   and Header Files."  If you make a mistake after your first build
   attempt, copy Makefile.ini to Makefile before retrying.  You may
   need to do this in the config subdirectory too, depending on what
   went wrong.

5) After make Makefiles, do make includes, make depend, then make (or
   as OSF recommends, make -k).  This gets as far as motifshell in the
   demos, which fails to build because O_RDONLY and L_XTND are
   not defined.  O_RDONLY is in fcntl.h (actually <sys/fcntl.h>, but
   fcntl.h includes this.)  L_XTND can be replaced by SEEK_END.
   SEEK_END is in stdio.h.  These two fixes will allow motifshell to build.
   Note: many MANY compiler warning messages will be generated during
   the build process.

6) You can go to the demos/xmsamplers directory and do a make there.
   Other demos may build, or not depending on whatever. . . .

7) make install will do the install.  [It will fail at motifshell
   if you don't fix it, as mentioned above.]  You can do a make install
   in demos/xmsamplers if you want these.

8) If running on a SUN (as opposed to an X term), you will (probably) need
   to start openwin with something like:

        openwin -server /usr/X11R5/bin/Xsun


   [You might want to use an alias for this.]
   This fixes an annoying problem: The mouse keys stop working after you
   click on an icon to get the icon menu (on SUNs only, not X terms).
   The ALT keys still work, if you get stuck.  I don't know whether this
   is a bug in SUN's server or whether it is Motif related.

   Here is a copy of my .xinitrc:  It's not elegant.  Sun's default
   openwin startup file is in: /usr/openwin/lib/Xinitrc.  You can
   copy this to ~/.xinitrc and customize as desired.  Obviously, the
   default behavior is to start the OpenLook environment (boo!).


#!/bin/sh
#
# .xinitrc - OpenWindows startup script.
#
if [ -f $HOME/.Xdefaults ]; then
    xrdb $HOME/.Xdefaults              # Load Users X11 resource database
fi
if [ -f $HOME/.Xdefaults.sun ]; then
    xrdb -merge $HOME/.Xdefaults.sun
fi
DISPLAY=`hostname`:0.0
export DISPLAY
xhost + > /dev/null
#xterm -sb -sl 512 -T `hostname` -ls -n `hostname` &
xterm -sb -sl 512 -T `hostname` -n `hostname` &
mwm &
xclock -geometry +1010+0 &
xload -geometry +710+5 -fg red &
xsetroot -solid salmon &
xterm -sb -sl 100 -T CONSOLE_DO_NOT_LOGOUT -C -n console -iconic
#wait

Here's .Xdefaults.sun, which gives me a more readable font for use with
motif on Sun monitors:

!Some additional .Xdefaults values specifically for SUN
!
! After loading .Xdefaults, xrdb -merge .Xdefaults.sun
!
Mwm*fontList:           8x16
!Mwm*fontList:          vtbold
!Change as desired.


     You will probably want to maintain LD_LIBRARY_PATH to something like:
/opt/SUNWspro/lib:/usr/ccs/lib:/usr/ucblib:/usr/X11R5/lib:/usr/lib:
/usr/openwin/lib.  If you use emacs, you will need to leave /usr/openwin/lib
there.  [This is because you probably, like me, used the distributed version
of s-sol2.h, which explicitly refers to windowing libraries as being in the
/usr/openwin locations.  Yes, I know that emacs/Solaris ought to allow
LibXt.so.N.M to be "picked up" from elsewhere, like /usr/X11R5/lib, but the
one emacs links with is LibXt.so.4.something, and the mit one is
LibXt.so.5.something.  So it seems to want the .4 one.  Any comments?  I'd
prefer not to rebuild emacs based on the X11R5 libs because I occassionally
need to move the emacs binaries to machines without the mit files.]

-----------------------------------------------------------------------------
Subject: 174)  What compile errors/warnings might I get in both Sun 3 and Sun
4?

Answer:


make: Warning: Too many rules defined for target
make: Warning: Too many rules defined for target
"callbacks.c", line 1530: warning: illegal combination of pointer
and integer, op =
"callbacks.c", line 1531: warning: illegal combination of pointer
and integer, op =
"callbacks.c", line 1532: warning: illegal combination of pointer
and integer, op =
"utils.c", line 73: warning: illegal combination of pointer and integer, op =
"utils.c", line 74: warning: illegal combination of pointer and integer, op =
"utils.c", line 122: warning: illegal combination of pointer and integer, op =
"utils.c", line 123: warning: illegal combination of pointer and integer, op =
"utils.c", line 191: warning: illegal combination of pointer and integer, op =
"utils.c", line 194: warning: illegal combination of pointer and integer, op =
"utils.c", line 195: warning: illegal combination of pointer and integer, op =
"utils.c", line 196: warning: illegal combination of pointer and integer, op =
"utils.c", line 316: warning: illegal combination of pointer and integer, op =
"utils.c", line 334: warning: illegal combination of pointer and integer, op =
"utils.c", line 338: warning: illegal combination of pointer and integer, op =
"utils.c", line 341: warning: illegal combination of pointer and integer, op =
"xmdialogs.c", line 838: warning: illegal combination of pointer
and integer, op =
"xmeditor.c", line 1152: warning: illegal combination of pointer
and integer, op =

These warning messages can be ignored. OSF is aware of these warnings.


-----------------------------------------------------------------------------
Subject: 175)  On a Sun 3, what are the mwm startup error messages about?  I
get

mwm: Invalid accelerator specification on line 7 of
     specification string
mwm: Invalid accelerator specification on line 31 of
      configuration file


Answer: This is because some Sun keyboards do not have an F10 key and some sun
workstations which have an F10 key do not have X-servers which recognize it.
The F10 key is used by mwm.  If the machine does have an F10 key, the user
should use xmodmap to tell the server it exists.  Otherwise, change the
definition of the DefaultWindowMenu in /usr/lib/X11/system.mwmrc (after
installation) or in /lib/clients/mwm/system.mwmrc (before installation).
Change the accelerator of "Maximize" (it is "Alt<Key>F10)" to something else.
Also, you should change the definition of DEFAULTSYSTEMMENU in the file
/clients/mwm/WmResource.c in a similar fashion.  There is as yet no standard
redefinition for F10.


-----------------------------------------------------------------------------
Subject: 176)  Are there problems making shared libraries on a Sun?

Answer: If you use the -pic option you may run out of offset table space.  use
the -PIC option instead.

You may get the message "ld.so: Undefined symbol: __XtInherit" when executing
UIL. There is a problem in shared library build when you compare a function
variable to a routine name, but don't call the routine.  Either, you can build
the Xt library nonshared, or you can put a reference to XtToolkitInitialize in
the UIL main program (or even include a module that references it).  The
routine doesn't even have to be called; it just has to be there.


-----------------------------------------------------------------------------
Subject: 177)  Why does the OpenWindows server hangs when I popup a menu with
Button 3?

[Last modified: August 92]

Answer: This is an OpenWindows problem, but if you have Motif source you can
fix your own applications. From Steve Sistare of Thinking Machines Corp.:
"Change the 2 calls to XtGrabButton in RowColumn.c such that ButtonReleaseMask
| ButtonPressMask is passed for the event mask.  Currently, only
ButtonReleaseMask is passed.  Also, change the owner_event argument to FALSE.
" This has not been fixed in Motif as at 1.1.5.

-----------------------------------------------------------------------------
Subject: 178)  Has anyone made shared libraries on an IBM RS/6000?

Answer: [NOTE: This may not a problem any longer; I believe that AIX is now
delivered with shared Xm libraries. If you know the status of this, email
ksall@cen.com.]

Sakari Jalovaara wrote: There is a problem: Xm redefines VendorShell and the
AIX linker put _both_ Xm's and Xt's VendorShell into programs.  When an AIX
shared library is created as many references inside the library are resolved
as possible.  If the symbol vendorShellClassRec is defined in libXt and
referenced, say, from a function XtFoo() also in libXt, the "ld" run that
creates the shared library resolves the reference:

        XtFoo() -> vendorShellClassRec

Then I create the Motif library that has its own vendorShellClassRec and an
XmBar() function that uses it; libXm will also contain a resolved reference to
vendorShellClassRec:

        XmBar() -> vendorShellClassRec

Finally, I link a program that uses both XtFoo() and XmBar() and the program
will end up with _two_ independent "vendorShellClassRec"s:

        XtFoo() -> vendorShellClassRec [Xt version]
        XmBar() -> vendorShellClassRec [Xm version]

Instant schizo zaphod mode.  In reality, vendorShellClassRec is not referenced
from functions but from other widget class records.

I can't just pull Vendor.o out from the shared Xt (Vendor.o appears to define
the only external symbols redefined by libXm) because AIX shared libraries


apparently can't contain unresolved external references.  If I take out
Vendor.o I have to take out every other file that uses symbols defined there -
and then files that need those files, etc.  I tried it and ended up with three
or four object files in libXt and the res non-sharable.

I kludged around this by putting all of libXt (minus Vendor.o) into the shared
libXm.  It isn't a pretty solution but it works - and beats having a
statically linked two-megabyte "periodic" demo...


-----------------------------------------------------------------------------
Subject: 179)  What is the error  "Unaligned access in XmString" under Ultrix?

Answer: Compile  XmString.c with STRINGS_ALIGNED.

-----------------------------------------------------------------------------
Subject: 180)  TOPIC: KEYSYMS

-----------------------------------------------------------------------------
Subject: 181)  What is causing the messages "unknown keysym osfDown..."?  It
happens when I run an application under Motif 1.1

Answer: There is an OSF supplied addition to the /usr/lib/X11/XKeysymDB file.
It is found on the release tape and should have been automatically installed
if the installation procedure was followed in the Release Notes.

You have to copy (or append) lib/Xm/XKeysymDB into /usr/lib/X11.  This may
require root permission.  It is not clear how to fix the problem if you can't
do this.  The error comes from Xt translation table parsing and can't be fixed
in Motif, so if you can't get root permission you may be stuck.  The file is
not copyrighted so you can install it on other systems.

If X has been built so that XKeysymDB is not in this directory, and you don't
know where it is looking, run 'strings libX11.a | grep XKeysymDB' to find the
path.

On a Sun running openwin with shared libraries, you may need to put the path
for the library containing XKeysymDB *first* in the path list in
LD_LIBRARY_PATH, or it may find the wrong XKeysymDB in the wrong directory.

XKeysymDB simply contains the registered keysym values for the OSF keysyms.
The OSF values are server-independent.  And, all registered keysyms will be
included in an XKeysymDB file to be shipped with X11R5.

In the meantime (till all systems are X11R5+), a list of the registered
keysyms can be found in the X11R4 release in mit/doc/Registry/Xregistry.

Also note the XKEYSYMDB environment variable. Setting this to point to the
XKeysymDB file often helps, but not always...


-----------------------------------------------------------------------------
Subject: 182)  What happens if I can't install Motif Keysyms?

tessi!george@nosun.West.Sun.COM (George Mitchell) wrote:

Here's what appears to happen if you don't have XKeysymDB in place to define
OSF's virtual keysyms:

1. At class initialize time, for a widget (such as XmText) that uses virtual
keysyms in its event translation table, all entries which refer to those
keysyms fail to parse correctly.  In the case of XmText, instead of ending up
with a translation table with roughly 90 entries, you end up with one that has
29.

2. XKeysymDB doesn't exist, so you'd assume that KeyPress events will get
translated to plain vanilla keysyms, right?  WRONG!  All Motif widgets install
a virtual keysym translator ANYWAY!  Consequently, the backspace key (for
example) gets translated to the keysym osfBackSpace.

3. Therefore, if you augment or override your widget's translations with
translations that refer to plain vanilla BackSpace, they will never be
triggered, because you will NEVER see plain vanilla BackSpace, only
osfBackSpace.

4. But you can't use osfBackSpace in an event translation entry, because you
don't have XKeysymDB installed!

Here's how I'm "dealing" with the problem right now: Motif installs its
virtual keysym translator by calling XtSetKeyTranslator every time a
VendorShell (or subclass) widget is created.  So every time I create a shell,
I immediately call XtSetKeyTranslator (display, XtTranslateKey) to restore the
default translator.  No more funny virtual keysyms!  Now I can reinstall non-
osfKeySym translations and have them work the way I expect.


-----------------------------------------------------------------------------
Subject: 183)  Why has OSF introduced Keysyms into Motif 1.1?  They weren't
there in Motif 1.0.

Answer: ellis@osf.org wrote:

Virtual Keysyms are meant to provide a consistent keyboard model for Motif
applications running in a heterogeneous environment in which proprietary (i.e.
vendor specific) non-Motif applications may also be running.

First of all, for the sake of the rest of the readers, let's explain why this
is an issue:

It would be lovely if Motif's translation tables could just use the obvious
keysyms predefined by X.  For example, there are keysyms for XK_BackSpace,
XK_Delete, XK_Left, XK_Right, etc.  Shouldn't these be the ones that are used
in our translations?  Unfortunately, the problem is not so simple.  Some
specific examples:

   While most vendors bind XK_BackSpace to the key at the top right
   of the standard keyboard (often engraved with a leftwards
   pointing arrow), not all do.  In fact, some vendors (including DEC)
   bind that key to XK_Delete.

   While most vendors bind the arrow keys to XK_Up, etc, a number of
   vendors (including Sun, on some servers) bind them to function key
   keysyms.

A simplistic solution would require the use of xmodmap to change the offending
bindings.  That would work swell in an all Motif environment.  However, OSF's
goal (not always perfectly achieved) is interoperability.  That is, we'd like
to make sure that both Motif and non-Motif programs can happily run in the
same environment.

It is expected that a vendor may have a wide variety of existing X-based
software that uses the keysyms as established by that vendor for specific
purposes.  It is expected that these applications may run at the same time as
Motif-based software.  Using xmodmap to change keysyms on the server side
could "break" the existing applications (or at the very least their
documentation) by making some keys unavailable, or by moving the location.

So, we chose not to use xmodmap.  By the way, though OpenLook uses a different
implementation (they recompile their virtual translation tables into actual
translation tables), they basically adopted the same approach, presumably for
similar reasons.

To work properly, the virtual keysym model we implemented depends on Xlib
finding XKeysymDB installed appropriately (which standard Motif installation
does).  This simply defines the keysyms (not the key they are bound to).  This
unfortunate piece of stupidity is necessary because MIT only includes standard
keysyms in keysymdef.h.  It should be said that our lives would be made easier
if MIT would also see fit to include registered keysyms in keysymdef.h as
well.

Motif applications determine how to bind virtual to actual keys by looking for
either a resource or a property on the root window which describes what to do.
Note that this information is on the server side, so that all applications use
the same virtual bindings regardless of where they are running.  Mwm will
happily create the property if it finds a .motifbind file in your home
directory when it starts up.  (Actually, things generally work even if none of
this is done, since if all else fails, the Motif toolkit chooses a virtual
bindings table to use based on the identification of the server).

The actual implementation of virtual keys is made possible by a hook in the
Intrinsics.  Undoubtably, the implementation would be simpler and cleaner if
virtual key support was more directly supported by the Intrinsics.  We will be
exploring this possibility in the future.

  -- Ellis

-----------------------------------------------------------------------------
Subject: 184)  Why do accented characters not work with Motif applications
linked with X11R6? What is the Compose file?

[Last modified: Feb 95]

Answer: Roman Czyborra (czyborra@cs.tu-berlin.de) writes:

I've xmodmapped a few accented characters onto my keyboard. They've worked
fine in most every window, but were dead in the Motif applications linked with
X11R6.  My LC_CTYPE has always been set to iso_8859_1, so that was not the
problem.  It turns out that I can activate the keys by patching
$XLOCALEDIR/iso8859-1/Compose to also include the lines listed below. I
couldn't find any documentation on the Compose file. Please include this in
the next release and the Motif FAQ.

<nobreakspace>          : "240"
<exclamdown>            : "241"
<cent>                  : "242"
<sterling>              : "243"
<currency>              : "244"
<yen>                   : "245"
<brokenbar>             : "246"
<section>               : "247"
<diaeresis>             : "250"
<copyright>             : "251"
<ordfeminine>           : "252"
<guillemotleft>         : "253"
<notsign>               : "255"
<hyphen>                : "255"
<registered>            : "256"
<macron>                : "257"
<degree>                : "260"
<plusminus>             : "261"
<twosuperior>           : "262"
<threesuperior>         : "263"
<acute>                 : "264
<mu>                    : "265"
<paragraph>             : "266"
<periodcentered>        : "267"
<cedilla>               : "240"
<onesuperior>           : "271"
<masculine>             : "272"
<guillemotright>        : "273"
<onequarter>            : "274"
<onehalf>               : "275"
<threequarters>         : "276"
<questiondown>          : "277"
<Agrave>                : "300"
<Aacute>                : "301"
<Acircumflex>           : "302"
<Atilde>                : "303"
<Adiaeresis>            : "304"
<Aring>                 : "305"
<AE>                    : "306"
<Ccedilla>              : "307"
<Egrave>                : "310"
<Eacute>                : "311"
<Ecircumflex>           : "312"
<Ediaeresis>            : "313"
<Igrave>                : "314"
<Iacute>                : "315"
<Icircumflex>           : "316"
<Idiaeresis>            : "317"
<ETH>                   : "320"
<Ntilde>                : "321"
<Ograve>                : "322"
<Oacute>                : "323"
<Ocircumflex>           : "324"
<Otilde>                : "325"
<Odiaeresis>            : "326"
<multiply>              : "327"
<Ooblique>              : "330"
<Ugrave>                : "331"
<Uacute>                : "332"
<Ucircumflex>           : "333"
<Udiaeresis>            : "334"
<Yacute>                : "335"
<THORN>                 : "336"
<ssharp>                : "337"
<agrave>                : "340"
<aacute>                : "341"
<acircumflex>           : "342"
<atilde>                : "343"
<adiaeresis>            : "344"
<aring>                 : "345"
<ae>                    : "346"
<ccedilla>              : "347"
<egrave>                : "350"
<eacute>                : "351"
<ecircumflex>           : "352"
<ediaeresis>            : "353"
<igrave>                : "354"
<iacute>                : "355"
<icircumflex>           : "356"
<idiaeresis>            : "357"
<eth>                   : "360"
<ntilde>                : "361"
<ograve>                : "362"
<oacute>                : "363"
<ocircumflex>           : "364"
<otilde>                : "365"
<odiaeresis>            : "366"
<division>              : "367"
<oslash>                : "370"
<ugrave>                : "371"
<uacute>                : "372"
<ucircumflex>           : "373"
<udiaeresis>            : "374"
<yacute>                : "375"
<thorn>                 : "376"
<ydiaeresis>            : "377"


-----------------------------------------------------------------------------
Subject: 185)  TOPIC: UIL

[NOTE: As you can see, this is a new topic area. Send me your ideas for
answered questions pertaining to this topic.]

-----------------------------------------------------------------------------
Subject: 186)  What is UIL and why is it so popular?

[Last modified: Sept 94]

Answer:

UIL is the acronym for "User Interface Language", a Motif standard which
permits separation of the user interface from application code.  UIL is a
textual description of the user interface which is compiled into binary form
called UID ("User Interface Definition") using the Motif-provided compiler
called "uil".

It is important to realize that UIL is a static description of the UI in that
connections between buttons and the dialogs they invoke, for example, is not
expressed here; dynamic UI behavior appears in C code.

The Period Table of Widgets, called "periodic" (delivered by many Motif
vendors) is an example of a UIL application.

There are many advantages and disadvantages of UIL applications.  A few of the
advantages are:

    UIL is a standard format which encourages separation of the
    user interface from application code.

    UIL can be read and/or written by many of the GUI builders and UIMS
    tools mentioned elsewhere in this FAQ, making your interface portable
    (to a degree) across builder tools.

    UIL is a much better language than C for defining a widget
    hierarchy: in C, the widget hierarchy is expressed "linearly"
    by referencing a previously-created parent widget when creating
    a child widget; in UIL, widget trees are defined more naturally
    using nesting.

    With UIL, you separate the definition of the widget tree from
    the application.  You can make major changes to the look-and-feel
    without re-building the application.

    It is possible to write a "general-purpose" application that defines
    a library of callbacks.  The application may "execute" any UIL file
    that references callbacks from the library.


For a good UIL reference, see "Motif Programming Manual", Volume 6A, published
by O'Reilly and Associates. [See "BOOKS" for details.]

-----------------------------------------------------------------------------
Subject: 187)  What is Mrm?

[Last modified: Nov 94]

Answer: Mrm is the "Motif Resource Manager", a set of functions (whose names
begin with Mrm, such as MrmFetchWidget and MrmRegisterNames) in libMrm.a which
retrieve the widget hierarchy from the UID file, associate callbacks, and
create the widgets.

Mrm is usually discussed in books which cover UIL.

    Motif Programming Manual, Volume 6A
    OSF/Motif Programmers Guide
    OSF/Motif Programmers Reference Manual

See the BOOKS section for detailed references.

-----------------------------------------------------------------------------
Subject: 188)  How do I specify a search path for ".uid" files?  Answer: Use
the UIDPATH environment variable.  It is documented on the MrmOpenHierarchy()
man page.

-----------------------------------------------------------------------------
Subject: 189)  Can I specify callback functions in resource files?

Answer: To specify callbacks, you must use UIL in addition to or in place of
resource files.  You can, however, specify translations in resource files,
which give you most of the same functionality as callback functions.

Thanks to Ken Lee, kenton@rahul.net

-----------------------------------------------------------------------------
Subject: 190)  How can I set a multiline label in UIL?

[Last modified: Sept 94]

Answer: In UIL, you have to explicitly create a compound string with a
separator.  Here's what W. Scott Meeks suggests:

value nl : compound_string('', seperate=true);

object my_label : XmLabel
{
    arguments
    {
        XmNlabelString = 'Here' & nl & 'is' & nl & 'the' & nl & 'Label';
    };
};


-----------------------------------------------------------------------------
Subject: 191)  Is there a program that can convert a UIL file to tclMotif?  I
have an old Motif program that I used on SCO unix. Now that I switched to
Linux, I would like to "reprogram" it without the Motif libraries under Linux.

[Last modified: Dec 94]

Answer: Jan Newmarch (jan@ise.canberra.edu.au) writes:

The latest version of tclMotif (v 1.3) will allow you to load uil files
(actually, the uid files output from the uil compiler) directly into tclMotif.
So you don't need to convert at all.

The source is available at ftp.x.org. This, plus a Linux binary are also at
ftp://ftp.canberra.edu/pub/motif/tclMotif

-----------------------------------------------------------------------------
END OF PART SEVEN
