home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-25 | 49.1 KB | 1,156 lines |
- Subject: Motif FAQ (Part 5 of 6)
- Newsgroups: comp.windows.x.motif,comp.answers,news.answers
- From: ksall@cen.com (Ken Sall)
- Date: 11 Oct 1994 07:52:09 GMT
-
- Archive-name: motif-faq/part5
- Last-modified: OCT 10, 1994
- Posting-Frequency: monthly
- Organization: Century Computing, Inc.
- Version: 3.8
-
-
-
- -----------------------------------------------------------------------------
- Subject: 139) 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: 140) TOPIC: SPECIFIC PLATFORMS
-
- -----------------------------------------------------------------------------
- Subject: 141) 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: 142)* 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: 143) 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: 144) 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: 145) 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: 146) 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: 147) 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.]
-
- From Sakari Jalovaara: 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: 148) What is the error "Unaligned access in XmString" under Ultrix?
-
- Answer: Compile XmString.c with STRINGS_ALIGNED.
-
- -----------------------------------------------------------------------------
- Subject: 149) TOPIC: KEYSYMS
-
- -----------------------------------------------------------------------------
- Subject: 150) 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: 151) What happens if I can't install Motif Keysyms?
-
- From: tessi!george@nosun.West.Sun.COM (George Mitchell)
-
- 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: 152) Why has OSF introduced Keysyms into Motif 1.1? They weren't
- there in Motif 1.0.
-
- Answer: From: ellis@osf.org
-
- 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: 153) 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: 154) 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: 155) What is Mrm?
-
- [Last modified: Sept 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.
-
- -----------------------------------------------------------------------------
- Subject: 156) 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: 157) 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@allegro.esd.sgi.com
-
- -----------------------------------------------------------------------------
- Subject: 158) 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: 159) TOPIC: ICONIFICATION and DE-ICONIFICATION
-
- Iconification/de-iconification is a co-operative process between a client and
- a window manager. The relevant standards are set by ICCCM. Mwm is ICCCM
- compliant. The toplevel (non-override-redirect) windows of an application may
- be in three states: WithdrawnState (neither the window nor icon visible),
- NormalState (the window visible) or IconicState (the icon window or pixmap
- visible). This information is contained in the WM_STATE property but ordinary
- clients are not supposed to look at that (its values have not yet been
- standardised). Movement between the three states is standardised by ICCCM.
-
- -----------------------------------------------------------------------------
- Subject: 160) How can I keep track of changes to iconic/normal window state?
-
- Answer: You can look at the WM_STATE property, but this breaks ICCCM
- guidelines. ICCCM compliant window managers will map windows in changing them
- to normal state and unmap them in changing them to iconic state. Look for
- StructureNotify events and check the event type:
-
- XtAddEventHandler (toplevel_widget,
- StructureNotifyMask,
- False,
- StateWatcher,
- (Opaque) NULL);
- ....
- void StateWatcher (w, unused, event)
- Widget w;
- caddr_t unused;
- XEvent *event;
- {
- if (event->type == MapNotify)
- printf ("normal\n");
- else if (event->type == UnmapNotify)
- printf ("iconified\n");
- else printf ("other event\n");
- }
-
-
- If you insist on looking at WM_STATE, here is some code (from Ken Sall) to do
- it:
-
- /*
- ------------------------------------------------------------------
- Try a function such as CheckWinMgrState below which returns one of
- IconicState | NormalState | WithdrawnState | NULL :
- ------------------------------------------------------------------
- */
- #define WM_STATE_ELEMENTS 1
-
- unsigned long *CheckWinMgrState (dpy, window)
- Display *dpy;
- Window window;
- {
- unsigned long *property = NULL;
- unsigned long nitems;
- unsigned long leftover;
- Atom xa_WM_STATE, actual_type;
- int actual_format;
- int status;
-
- xa_WM_STATE = XInternAtom (dpy, "WM_STATE", False);
-
- status = XGetWindowProperty (dpy, window,
- xa_WM_STATE, 0L, WM_STATE_ELEMENTS,
- False, xa_WM_STATE, &actual_type, &actual_format,
- &nitems, &leftover, (unsigned char **)&property);
-
- if ( ! ((status == Success) &&
- (actual_type == xa_WM_STATE) &&
- (nitems == WM_STATE_ELEMENTS)))
- {
- if (property)
- {
- XFree ((char *)property);
- property = NULL;
- }
- }
- return (property);
- } /* end CheckWinMgrState */
-
-
- One problem with testing WM_STATE is that a race condition is possible;
- immediately after testing it, it could change, and the logic proceeds to
- behave as if it were in the old state.
-
- -----------------------------------------------------------------------------
- Subject: 161) How can I check if my application has come up iconic? I want
- to delay initialization code and other processing.
-
- Answer: Use XtGetValues and check for the XmNinitialState value of the
- toplevel shell just before XtMainLoop. -- IconicState is iconic, NormalState
- is not iconic.
-
-
- -----------------------------------------------------------------------------
- Subject: 162) How can I start my application in iconic state?
-
- Answer: From the command line
-
- application -iconic
-
- Using the resource mechanism, set the resource XmNinitialState to IconicState
- of the toplevel shell widget (the one returned from XtInitialise).
-
- -----------------------------------------------------------------------------
- Subject: 163) How can an application iconify itself?
-
- Answer: In R4 and later, use the call XIconifyWindow.
-
- For R3, send an event to the root window with a type of WM_CHANGE_STATE and
- data IconicState.
-
- void
- IconifyMe (dpy, win)
- Display *dpy;
- Window win; /* toplevel window to iconify */
- {
- Atom xa_WM_CHANGE_STATE;
- XClientMessageEvent ev;
-
- xa_WM_CHANGE_STATE = XInternAtom (dpy,
- "WM_CHANGE_STATE", False);
-
- ev.type = ClientMessage;
- ev.display = dpy;
- ev.message_type = xa_WM_CHANGE_STATE;
- ev.format = 32;
- ev.data.l[0] = IconicState;
- ev.window = win;
-
- XSendEvent (dpy,
- RootWindow (dpy, DefaultScreen(dpy)),
- True,
- (SubstructureRedirectMask | SubstructureNotifyMask),
- &ev);
- XFlush (dpy);
- }
-
-
- -----------------------------------------------------------------------------
- Subject: 164) How can an application de-iconify itself?
-
- Answer: XMapWindow (XtDisplay (toplevel_widget), XtWindow (toplevel_widget)).
-
- -----------------------------------------------------------------------------
- Subject: 165) TOPIC: SPECIALIZED WIDGETS
-
- [Last modified: Sept 94]
-
- This section describes a few specialized widgets people have asked about. A
- _far_ more comprehensive illustrated list is maintained by John L. Cwikla
- (cwikla@wri.com). His list covers these widget categories:
-
- Composite Widgets
- Non-Composite Widgets
- Motif 1.1 Compatible
- Motif 1.2 Compatible
- Athena Compatible
- FWF Widget Set
- By Author
- Shareware Widgets
- Commercial Widgets
-
- For John L. Cwikla's Widget FAQ Home Page, WWW users should see:
-
- http://www.wri.com/~cwikla/widget.html
-
- If you don't have access to the World Wide Web, Cwikla's Widget FAQ (sans
- pictures) can be obtained from ftp.x.org:
-
- /contrib/faqs/Widget.FAQ.Z
-
- The widgets discussed currently include:
-
- Alert Animator AppPlusShell Array Arrow Board Button ButtonFaceLib
- Canvas CircularPercentage Cmap Common ComboBox EzMenu FileChooser
- FileComplete FileSelector Frame Group HScrollBar Hdial Histogram
- Icon IconBox ImageSelector Label Mdial MenuBar MPEG MultiList
- NewToggle OptionButton Pager PEXtWorkstation PieMenu PixelEditor
- Prompt PullDown RadioGroup RheoStat RowCol ScrolledList ScrolledWindow
- Scrollbar Shistogram Slider2 SmartMessageBox SpinButton Stack Tabs
- TextMenu ThumbWheel Toggle VScrollbar XbaeCaption XbaeMatrix XeAudio
- XeFrame XeRaster XeText XeTextEd XeVideo XmtChooser XmtCli
- XmtHelpBrowser XmtHelpBox XmtLayout XmtMenu XmtMsgLine XmtInputField
- and xhdg
-
-
- -----------------------------------------------------------------------------
- Subject: 166) Where can I get a Table widget? Matrix widget? Spreadsheet
- widget?
-
- [Last modified: Sept 94]
-
- Answer: Kee Hinckley (now: nazgul@utopia.com) recently informed this FAQ
- maintainer that he will put the Table widget on ftp at ftp.utopia.com
- _approximately_ at the end of September or early October, 1994. He is in the
- process of addressing some issues concerning Motif 1.2 and higher with respect
- to the Table widget. The Widget Creation Library (Wcl) also has a version of
- the Table widget.
-
- In the Xbae README, Andrew Wason (aw@bae.bellcore.com) writes: XbaeMatrix is a
- Motif widget which presents an editable array of string data to the user in a
- scrollable table similar to a spreadsheet. The rows and columns of the Matrix
- may optionally be labeled. Also, a number of "fixed" leading rows or columns
- may be specified - these behave similarly to the labels. While XbaeMatrix
- looks and acts like a grid of XmTextField widgets, it actually contains only
- one XmTextField. This means that XbaeMatrix widgets with hundreds or
- thousands of rows have much less overhead than they would if they used an
- XmTextField for each cell. XbaeMatrix has callbacks for doing field validation
- and customizing traversal. It allows cells to be assigned independent colors.
- It allows rows, columns and regions of cells to be selected (highlighted).
- The matrix can be dynamically grown or shrunk by adding and deleting rows and
- columns at any position.
-
- For Xbae code and documentation via ftp, see the various files
- ftp.x.org:/contrib/widgets/motif/Xbae-*.
-
-
- Expert Database Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.
- Phone: (212) 783-6981 has a very comprehensive table widget that uses both
- Motif scrollbars or a "virtual" scrollbar showing a miniature version of the
- entire spreadsheet. Allows for different width columns, changing colors in
- each cell. Only one X-Window is used so as to reduce the amount of system
- resources used. Contact Ken Jones email: ken@mr_magoo.sbi.com)
-
-
- -----------------------------------------------------------------------------
- Subject: 167) Where can I get a bar graph widget?
- [Last modified: Sept 94]
-
- Answer: You can fake one by using for each bar a scroll bar or even a label
- which changes in size, put inside a container of some kind.
-
- Try the StripChart widget in the Athena widget set. Set the XtNupdate resource
- to 0 to keep it from automatically updating.
-
- The comp.windows.x FAQ mentions a bar graph widget.
-
- Expert Database Systems, Inc. sells a bar graph widget as well as a multi-
- line graph with automatic scaling, a 3-D surface graph, and a high/Low graph
- with two lines for moving averages. Contact Ken Jones Expert Database
- Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280. Phone: (212)
- 783-6981
-
-
- The Xtra XWidget library contains a set of widgets that are subclassed from
- and compatible with either OSF/Motif or OLIT widgets. The library includes
- widgets that implement the following:
-
- Spreadsheet
- Bar Graph
- Stacked Bar Graph
- Line Graph
- Pie Chart
- XY Plot
- Hypertext
- Hypertext based Help System
- Entry Form with type checking
-
- Contact Graphical Software Technology at 310-328-9338 (info@gst.com) for
- information.
-
- The XRT/graph widget, available for Motif, XView and OLIT, displays X-Y plots,
- bar and pie charts, and supports user-feedback, fast updates and PostScript
- output. Contact KL Group Inc. at 416-594-1026 (xrt_info%klg@uunet.ca)
-
- The product Xmath, made by Integrated Systems Inc. is a product which has
- interactive 2d and 3d graphics for bar,strip,line,symbol,
- surface,contour,etc... that costs $2500.00 for commercial use and a mere
- $250.00 for university use that also has complete numerics capabilities, an
- easy to use debugger, a complete high level language, a spreadsheet, a motif
- gui access capability, and much more all created on top of motif.
-
- You can either email to xmath-info@isi.com or call (408)980-1500.
-
- Digital Equipment Corporation (DEC) provides the following product NetEd: "The
- network editor widget is a Motif toolkit conforming widget that applications
- can use to express complex interrelationships graphically in the form of
- networks or graphs. The network editor supports interactive or application-
- controlled creation and editing of directed graphs or networks."
-
-
- ACE/gr is an X based XY plotting tool implemented with a point 'n click
- paradigm. A few of its features are:
-
- * Plots up to 10 graphs with 30 data sets per graph.
- * Data read from files and/or pipes.
- * Graph types XY, log-linear, linear-log, log-log, bar,
- stacked bar charts.
-
- it is available from
-
- ftp.ccalmr.ogi.edu (presently amb4.ccalmr.ogi.edu)
-
- with IP address 129.95.72.34. The XView version (xvgr) will be found in
- /CCALMR/pub/acegr/xvgr-2.09.tar.Z and the Motif version (xmgr) in
- /CCALMR/pub/acegr/xmgr-2.09.tar.Z. Comments, suggestions, bug reports to
- pturner@amb4.ccalmr.ogi.edu (if mail fails, try pturner@ese.ogi.edu). Due to
- time constraints, replies will be few and far between.
-
- Caterpillar, Inc. sells the ENGOTS (Engineering Graphic Object Tool Set)
- widget set for Motif. The library includes interactive plotting, built in
- units conversion,copy-cut-past, postscript output, ... :
-
-
- XY/contour Plot (configurable to Bar plots)
- XY/contour Strip Charts
- Polar Plot
- Custom Interactive Drawing (using provided Drawing Package)
- float/int data entry (Motif Text "Look and Feel") with range checking
-
-
- Contact Paul Mauschbaugh, Caterpillar, Inc. at 309-578-4084 (mush@cat.com) for
- more information.
-
- -----------------------------------------------------------------------------
- Subject: 168) Is there a graph widget in which you can add vertices and edges
- and get automatic updating?
-
- [Last modified: March 93]
-
- Answer: The XUG FAQ in comp.windows.x includes information on graph display
- widgets. There is also an implementation in the Asente/Swick book.
-
- From Martin Janzen: "You could have a look at DataViews, from V.I.
- Corporation. This package is used mainly to display a variety of graph
- drawings (eg. bar, line, pie, high/low, and other charts), and to update
- the graphs as information is received from "data sources" such as files,
- processes (through pipes), or devices.
-
- However, it also provides "node" and "edge" objects which can be used
- when working with network graphs. The DV-Tools function library
- provides routines which traverse a graph, count visits to each node or
- edge, mark nodes or edges of interest, and so on. A node or edge object
- can have an associated "geometry object" (such as a symbol or a line),
- which represents that node or edge.
-
- Drawbacks: There's no automatic positioning algorithm; when you add a
- node or edge, you have to create and position its geometry object
- yourself. Also, this isn't a set of add-on widgets; you can either have
- DataViews create an X window (ie. a separate shell), or you can create
- your own XmDrawingArea and use DataViews to update its window when
- expose events are received. Finally, the package is quite expensive,
- and there is a run-time charge.
-
- The vendor's address is:
- V.I. Corporation,
- 47 Pleasant Street,
- Northampton, MA 01060,
- Email: vi@vicorp.com, Phone: (413) 586-4144, Fax: (413) 584-2649
-
- or
-
- V.I. Corporation (Europe) Ltd.,
- First Base, Beacontree Plaza,
- Gillette Way, Email: viesales@eurovi.uucp
- Reading, Berkshire RG2 0BP"
- Phone: +44 734 756010, Fax: +44 734 756104
-
- From Craig Timmerman: Just wanted others to know that there is a third
- competitor in what may be come a big market for generic APIs. The product is
- called Open Interface and Neuron Data is the vendor. Neuron has added some
- extra, more complex widgets to their set. The two most notable are a table
- and network widget. [...] I believe that the network widget got its name from
- its ability to display expert system networks that Neuron's AI tools needed.
- It would be more aptly named the graph widget. It can display and manipulate
- graphs of various types (trees, directed graphs, etc). Contact is
-
- Neuron Data
- 156 University Avenue
- Palo Alto, CA 94301
- (415) 321-4488
-
-
- prism!gt3273b@gatech.edu (RENALDS,ANDREW THEODORE) posted a set of public
- domain routines for graph drawing. Contact him for a later set.
-
- From Ramon Santiago (santiago@fgssu1.fgs.slb.com): HP has released source code
- for XmGraph and XmArc, part of the InterWorks library, which does exactly
- this. The sources can be obtained by contacting Dave Shaw,
- librarian@iworks.ecn.uiowa.edu. A few trivial source code changes need to be
- made to get these widgets to compile under Motif 1.2.
-
- Free DAG - directed acyclic graph drawing software in motif environment is
- available. Please send a note to address below if you want it:
-
- Budak Arpinar, TUBITAK Software Research & Development Center, Ankara,
- TURKIYE, E-mail : C51881@TRMETU.BITNET
-
-
- -----------------------------------------------------------------------------
- Subject: 169) Is there a help system available, such as in Windows 3? Or any
- Motif based hypertext system.
-
- [Last modified: Apr 94]
-
- Answer:
-
- HTML Widget from NCSA:
-
- The NCSA Mosaic for X package contains an HTML widget which is freely
- available and is the main vehicle for viewing HTML documents in the Mosaic
- program. It has callbacks for anchor hits, selections, etc and many many
- resources for customizing the viewing area of your hypertext documents. See
- "Where can I get the HTML widget" above.
-
- GWHIS:
-
- There is a new product from Quadralay Corporation, called the Global-Wide Help
- & Information Systems (GWHIS).
-
- from a press release: AUSTIN, TX (March 3, 1994) Quadralay Corporation today
- announced its newest software development tool, Global Wide Help & Information
- System (GWHIS). GWHIS allows third party application developers to add online
- documentation and context sensitive help to their applications like never
- before. This documentation may consist of plain text, rich format text,
- hypertext, images, audio, and/or video animation and may easily be distributed
- either locally or over a wide area network such as the Internet.
-
- GWHIS consists of two primary components. An application programming
- interface (API), and a hypermedia viewer (based on technology licensed from
- the NCSA Mosaic project). Several ancillary conversion programs are also
- available allowing end users to easily convert existing documentation into
- GWHIS' native HTML format.
-
- GWHIS is available on the following platforms: SPARC SunOS 4.1.x, SPARC
- Solaris 2.x, INTEL SCO Open Desktop, INTEL Solaris 2.x, HP 9000/700, and the
- RS/6000. Support for additional platforms (including MS Windows and Macintosh)
- is under consideration. Fully functional evaluation copies of this software
- are available upon request or via anonymous ftp from ftp.quadralay.com.
-
- Brian Combs Quadralay Corporation combs@quadralay.com
-
-
- Bristol Technology have a hypertext system HyperHelp with the look-and-feel of
- either Motif or OpenLook. It should be available from january 31, 1992.
- Contact
-
- Bristol Technology Inc.
- 898 Ethan Allen Highway
- Ridgefield, CT 06877
- 203-438-6969 (phone)
- 203-438-5013 (fax)
- uunet.uu.net!bristol!keith
-
- Demos are available by anonymous ftp from ftp.uu.net (137.39.1.9) in the
- vendor/Bristol/HyperHelp as files sun.motif.tar.Z and hp.tar.Z.
-
- There was a posting of a motif hypertext-widget to comp.sources.x (Author:
- B.Raoult ( mab@ecmwf.co.uk ) ). It had the facility to read in helptext from
- a file.
-
- From Francois Felix Ingrand (felix@idefix.laas.fr): I have translated the Info
- AW (originally written by Jordan Hubbard) to Motif. It is a Widget to browse
- Info files (format used by GNU for their various documentations). I use it as
- the help system of various tool I wrote. It is available on laas.laas.fr
- (140.93.0.15) in /pub/prs/xinfo-motif.tar.Z
-
- Form Scott Raney (raney@metacard.com) MetaCard is a commercial package that
- can be used to implement hypertext help. The text fields support multiple
- typefaces, sizes, styles, colors, subscript/superscript, and hypertext links.
- It has a Motif interface, and a template for calling it from an Xt/Motif
- application is included. You can FTP a save-disabled distribution from
- ftp.metacard.com or from world.std.com. For more info, email to
- info@metacard.com.
-
-
- The Motifation GbR also provides a hypertext-helpsystem named 'XpgHelp'.
- (Motif look-and-feel / features like those known from MS Windows Help ) For a
- free demo or more information send email either to griebel@uni-paderborn.d e
- or contact the distributor:
-
- PEM GmbH,
- Vaihinger Strasse 49,
- 7000 Stuttgart 80,
- Germany,
- +49 (0) 711 713045 (phone),
- +49 (0) 711 713047 (fax),
- email: basien@pem-stuttgart.de
-
- XpgHelp has nearly the same features like HyperHelp: (multiple fonts, graphics
- in b&w and color, different styles, tabs, links, short links, notepad, ...)
-
- The Interface Builder MOTIFATION uses XpgHelp as its hypertext helpsystem.
-
- -----------------------------------------------------------------------------
- Subject: 170)+ Is there a canvas widget or drawing widget for graphical
- display?
-
- [Last modified: Oct 94]
-
- Answer: Groupe Bull - Koala Project has a Motif Canvas Widget. This widget is
- intended to provide graphical display (lines, rectangles, icons,...) and
- direct manipulation services (select, move, resize,...) for Xt based
- applications. This widget is intended to be include in a MOTIF application,
- but you can generate an Athena widget (though demos are only using MOTIF). The
- widget is shipped with an objects library based on a C object oriented model
- called KLONE (use of the Xt object model would dramaticaly increase
- application load time and KLONE provides garbage collection). Features:
-
- - uses an improved C small object-oriented model (garbage col. + polymorphism)
- - multi-view: an object may be shared between two views (canvases)
- - Multi-display: two views may be on different displays / screens
- - double buffering for smooth animations
- - easy to use "just know how to use widgets"
- - small objects
- - garbage collection
- - Tag object to define graphical object appearance
- - define tag's attributes with Xt resources
- - dispatch mechanism uses Xt -> you can set Xt translations on a graphic obj
- - Interactor objects to define a complete behavior
- - unlimited Zoom / Unzoom
- - classes: Line, Rect, Filled rect, Xpm Icon, Group, Ellipse, Anchor, Link
- - mouse interactors: move, resize
-
- Requirements: MOTIF, XPM
-
- See http://zenon.inria.fr:8003/koala/koala.html and
- ftp://avahi.inria.fr/pub/widgets/canvas-widget-1.7.tar.gz
-
- Thanks to Jean-Michel.Leon@sophia.inria.fr.
-
- -----------------------------------------------------------------------------
- Subject: 171)+ TOPIC: CREATING WIDGETS
-
- [Looking for submissions: questions asked and answered here, folks!]
-
- -----------------------------------------------------------------------------
- Subject: 172)+ What are some good references on creating widgets?
-
- [Last modified: Oct 94]
-
- Answer: Ken Sall (ksall@cen.com) writes:
-
- If you have Motif 2.0, see the new document provided by OSF called "OSF/Motif
- Widget Writer's Guide" in the directory: doc/widgetGuide/Output/draft/ps.
-
- If you have Motif 1.*, try these references (details in the BOOKS topic):
-
- Asente, Paul J., and Swick, Ralph R.,
- X Window System Toolkit, The Complete Programmer's Guide and Specification.
-
- Nye, Adrian & O'Reilly, Tim,
- X Toolkit Intrinsics Programming Manual.Motif Edition, Volume 4M
-
- Flanagan, David, Editor,
- X Toolkit Intrinsics Reference Manual, Volume 5
-
-
- Alex Fridman (alex@genlogic.com) writes:
-
- For graphical widgets, you may try the Generic Logic Toolkit. It allows custom
- graphical widgets (such as Graphs and Controls) to be created interactively
- from the supplied templates using the GLG 3D Graphical Editor. A Demo is
- available by ftp from:
-
- ftp://ftp.netcom.com/pub/glg/
-
- -----------------------------------------------------------------------------
- END OF PART FIVE
-
-