home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / faqs / comp / answers / motif-faq / part8 < prev    next >
Encoding:
Internet Message Format  |  1997-10-19  |  63.2 KB

  1. Path: senator-bedfellow.mit.edu!faqserv
  2. From: kenton@rahul.net (Ken Lee)
  3. Newsgroups: comp.windows.x.motif,comp.answers,news.answers
  4. Subject: Motif FAQ (Part 8 of 9)
  5. Supersedes: <motif-faq/part8_875789459@rtfm.mit.edu>
  6. Followup-To: poster
  7. Date: 18 Oct 1997 10:15:43 GMT
  8. Organization: none
  9. Lines: 1521
  10. Approved: news-answers-request@MIT.EDU
  11. Distribution: inet
  12. Expires: 1 Dec 1997 10:06:58 GMT
  13. Message-ID: <motif-faq/part8_877169218@rtfm.mit.edu>
  14. References: <motif-faq/part1_877169218@rtfm.mit.edu>
  15. Reply-To: kenton@rahul.net (Ken Lee)
  16. NNTP-Posting-Host: penguin-lust.mit.edu
  17. Summary: Motif Frequently Asked Questions (with answers).
  18. Keywords: FAQ question answer
  19. X-Last-Updated: 1997/08/27
  20. Originator: faqserv@penguin-lust.MIT.EDU
  21. Xref: senator-bedfellow.mit.edu comp.windows.x.motif:60056 comp.answers:28584 news.answers:114856
  22.  
  23. Archive-name: motif-faq/part8
  24. Last-modified: SEP 1, 1997
  25. Posting-Frequency: irregular
  26. Organization: Kenton Lee, X/Motif Consultant, http://www.rahul.net/kenton/
  27. URL:  http://www.rahul.net/kenton/faqs/mfaq_index.html
  28. Version: 6.3
  29.  
  30. -----------------------------------------------------------------------------
  31. Subject: 248)  TOPIC: KEYSYMS
  32.  
  33. -----------------------------------------------------------------------------
  34. Subject: 249)  What is causing the messages "unknown keysym osfDown..."?  It
  35. happens when I run an application under Motif 1.1
  36.  
  37. Answer:  There is an OSF supplied addition to the /usr/lib/X11/XKeysymDB file.
  38. It is found on the release tape and should have been automatically installed
  39. if the installation procedure was followed in the Release Notes.
  40.  
  41. You have to copy (or append) lib/Xm/XKeysymDB into /usr/lib/X11.  This may
  42. require root permission.  It is not clear how to fix the problem if you can't
  43. do this.  The error comes from Xt translation table parsing and can't be fixed
  44. in Motif, so if you can't get root permission you may be stuck.  The file is
  45. not copyrighted so you can install it on other systems.
  46.  
  47. If X has been built so that XKeysymDB is not in this directory, and you don't
  48. know where it is looking, run 'strings libX11.a | grep XKeysymDB' to find the
  49. path.
  50.  
  51. On a Sun running openwin with shared libraries, you may need to put the path
  52. for the library containing XKeysymDB *first* in the path list in
  53. LD_LIBRARY_PATH, or it may find the wrong XKeysymDB in the wrong directory.
  54.  
  55. XKeysymDB simply contains the registered keysym values for the OSF keysyms.
  56. The OSF values are server-independent.  And, all registered keysyms will be
  57. included in an XKeysymDB file to be shipped with X11R5.
  58.  
  59. In the meantime (till all systems are X11R5+), a list of the registered
  60. keysyms can be found in the X11R4 release in mit/doc/Registry/Xregistry.
  61.  
  62. Also note the XKEYSYMDB environment variable. Setting this to point to the
  63. XKeysymDB file often helps, but not always...
  64.  
  65.  
  66. -----------------------------------------------------------------------------
  67. Subject: 250)  What happens if I can't install Motif Keysyms?
  68.  
  69. tessi!george@nosun.West.Sun.COM (George Mitchell) wrote:
  70.  
  71. Here's what appears to happen if you don't have XKeysymDB in place to define
  72. OSF's virtual keysyms:
  73.  
  74. 1. At class initialize time, for a widget (such as XmText) that uses virtual
  75. keysyms in its event translation table, all entries which refer to those
  76. keysyms fail to parse correctly.  In the case of XmText, instead of ending up
  77. with a translation table with roughly 90 entries, you end up with one that has
  78. 29.
  79.  
  80. 2. XKeysymDB doesn't exist, so you'd assume that KeyPress events will get
  81. translated to plain vanilla keysyms, right?  WRONG!  All Motif widgets install
  82. a virtual keysym translator ANYWAY!  Consequently, the backspace key (for
  83. example) gets translated to the keysym osfBackSpace.
  84.  
  85. 3. Therefore, if you augment or override your widget's translations with
  86. translations that refer to plain vanilla BackSpace, they will never be
  87. triggered, because you will NEVER see plain vanilla BackSpace, only
  88. osfBackSpace.
  89.  
  90. 4. But you can't use osfBackSpace in an event translation entry, because you
  91. don't have XKeysymDB installed!
  92.  
  93. Here's how I'm "dealing" with the problem right now: Motif installs its
  94. virtual keysym translator by calling XtSetKeyTranslator every time a
  95. VendorShell (or subclass) widget is created.  So every time I create a shell,
  96. I immediately call XtSetKeyTranslator (display, XtTranslateKey) to restore the
  97. default translator.  No more funny virtual keysyms!  Now I can reinstall non-
  98. osfKeySym translations and have them work the way I expect.
  99.  
  100.  
  101. -----------------------------------------------------------------------------
  102. Subject: 251)  Why has OSF introduced Keysyms into Motif 1.1?  They weren't
  103. there in Motif 1.0.
  104.  
  105. Answer:  ellis@osf.org wrote:
  106.  
  107. Virtual Keysyms are meant to provide a consistent keyboard model for Motif
  108. applications running in a heterogeneous environment in which proprietary (i.e.
  109. vendor specific) non-Motif applications may also be running.
  110.  
  111. First of all, for the sake of the rest of the readers, let's explain why this
  112. is an issue:
  113.  
  114. It would be lovely if Motif's translation tables could just use the obvious
  115. keysyms predefined by X.  For example, there are keysyms for XK_BackSpace,
  116. XK_Delete, XK_Left, XK_Right, etc.  Shouldn't these be the ones that are used
  117. in our translations?  Unfortunately, the problem is not so simple.  Some
  118. specific examples:
  119.  
  120.    While most vendors bind XK_BackSpace to the key at the top right
  121.    of the standard keyboard (often engraved with a leftwards
  122.    pointing arrow), not all do.  In fact, some vendors (including DEC)
  123.    bind that key to XK_Delete.
  124.  
  125.    While most vendors bind the arrow keys to XK_Up, etc, a number of
  126.    vendors (including Sun, on some servers) bind them to function key
  127.    keysyms.
  128.  
  129. A simplistic solution would require the use of xmodmap to change the offending
  130. bindings.  That would work swell in an all Motif environment.  However, OSF's
  131. goal (not always perfectly achieved) is interoperability.  That is, we'd like
  132. to make sure that both Motif and non-Motif programs can happily run in the
  133. same environment.
  134.  
  135. It is expected that a vendor may have a wide variety of existing X-based
  136. software that uses the keysyms as established by that vendor for specific
  137. purposes.  It is expected that these applications may run at the same time as
  138. Motif-based software.  Using xmodmap to change keysyms on the server side
  139. could "break" the existing applications (or at the very least their
  140. documentation) by making some keys unavailable, or by moving the location.
  141.  
  142. So, we chose not to use xmodmap.  By the way, though OpenLook uses a different
  143. implementation (they recompile their virtual translation tables into actual
  144. translation tables), they basically adopted the same approach, presumably for
  145. similar reasons.
  146.  
  147. To work properly, the virtual keysym model we implemented depends on Xlib
  148. finding XKeysymDB installed appropriately (which standard Motif installation
  149. does).  This simply defines the keysyms (not the key they are bound to).  This
  150. unfortunate piece of stupidity is necessary because MIT only includes standard
  151. keysyms in keysymdef.h.  It should be said that our lives would be made easier
  152. if MIT would also see fit to include registered keysyms in keysymdef.h as
  153. well.
  154.  
  155. Motif applications determine how to bind virtual to actual keys by looking for
  156. either a resource or a property on the root window which describes what to do.
  157. Note that this information is on the server side, so that all applications use
  158. the same virtual bindings regardless of where they are running.  Mwm will
  159. happily create the property if it finds a .motifbind file in your home
  160. directory when it starts up.  (Actually, things generally work even if none of
  161. this is done, since if all else fails, the Motif toolkit chooses a virtual
  162. bindings table to use based on the identification of the server).
  163.  
  164. The actual implementation of virtual keys is made possible by a hook in the
  165. Intrinsics.  Undoubtably, the implementation would be simpler and cleaner if
  166. virtual key support was more directly supported by the Intrinsics.  We will be
  167. exploring this possibility in the future.
  168.  
  169.   -- Ellis
  170.  
  171. -----------------------------------------------------------------------------
  172. Subject: 252)  Why do accented characters not work with Motif applications
  173. linked with X11R6? What is the Compose file?
  174.  
  175. [Last modified: June 95]
  176.  
  177. Answer:  Note: The list of codes below _should_ contain a backslash before
  178. every numeric value. My FAQ maintainence tools have been stripping the
  179. backslash.  Sorry for the confusion...ksall@cen.com.
  180.  
  181. Roman Czyborra (czyborra@cs.tu-berlin.de) writes:
  182.  
  183. I've xmodmapped a few accented characters onto my keyboard. They've worked
  184. fine in most every window, but were dead in the Motif applications linked with
  185. X11R6.  My LC_CTYPE has always been set to iso_8859_1, so that was not the
  186. problem.  It turns out that I can activate the keys by patching
  187. $XLOCALEDIR/iso8859-1/Compose to also include the lines listed below.
  188.  
  189.  
  190.                                     - 11 -
  191.  
  192.  
  193. <nobreakspace>          : "240"
  194. <exclamdown>            : "241"
  195. <cent>                  : "242"
  196. <sterling>              : "243"
  197. <currency>              : "244"
  198. <yen>                   : "245"
  199. <brokenbar>             : "246"
  200. <section>               : "247"
  201. <diaeresis>             : "250"
  202. <copyright>             : "251"
  203. <ordfeminine>           : "252"
  204. <guillemotleft>         : "253"
  205. <notsign>               : "255"
  206. <hyphen>                : "255"
  207. <registered>            : "256"
  208. <macron>                : "257"
  209. <degree>                : "260"
  210. <plusminus>             : "261"
  211. <twosuperior>           : "262"
  212. <threesuperior>         : "263"
  213. <acute>                 : "264
  214. <mu>                    : "265"
  215. <paragraph>             : "266"
  216. <periodcentered>        : "267"
  217. <cedilla>               : "240"
  218. <onesuperior>           : "271"
  219. <masculine>             : "272"
  220. <guillemotright>        : "273"
  221. <onequarter>            : "274"
  222. <onehalf>               : "275"
  223. <threequarters>         : "276"
  224. <questiondown>          : "277"
  225. <Agrave>                : "300"
  226. <Aacute>                : "301"
  227. <Acircumflex>           : "302"
  228. <Atilde>                : "303"
  229. <Adiaeresis>            : "304"
  230. <Aring>                 : "305"
  231. <AE>                    : "306"
  232. <Ccedilla>              : "307"
  233. <Egrave>                : "310"
  234. <Eacute>                : "311"
  235. <Ecircumflex>           : "312"
  236. <Ediaeresis>            : "313"
  237. <Igrave>                : "314"
  238. <Iacute>                : "315"
  239. <Icircumflex>           : "316"
  240. <Idiaeresis>            : "317"
  241. <ETH>                   : "320"
  242. <Ntilde>                : "321"
  243. <Ograve>                : "322"
  244. <Oacute>                : "323"
  245. <Ocircumflex>           : "324"
  246. <Otilde>                : "325"
  247. <Odiaeresis>            : "326"
  248. <multiply>              : "327"
  249. <Ooblique>              : "330"
  250. <Ugrave>                : "331"
  251. <Uacute>                : "332"
  252. <Ucircumflex>           : "333"
  253. <Udiaeresis>            : "334"
  254. <Yacute>                : "335"
  255. <THORN>                 : "336"
  256. <ssharp>                : "337"
  257. <agrave>                : "340"
  258. <aacute>                : "341"
  259. <acircumflex>           : "342"
  260. <atilde>                : "343"
  261. <adiaeresis>            : "344"
  262. <aring>                 : "345"
  263. <ae>                    : "346"
  264. <ccedilla>              : "347"
  265. <egrave>                : "350"
  266. <eacute>                : "351"
  267. <ecircumflex>           : "352"
  268. <ediaeresis>            : "353"
  269. <igrave>                : "354"
  270. <iacute>                : "355"
  271. <icircumflex>           : "356"
  272. <idiaeresis>            : "357"
  273. <eth>                   : "360"
  274. <ntilde>                : "361"
  275. <ograve>                : "362"
  276. <oacute>                : "363"
  277. <ocircumflex>           : "364"
  278. <otilde>                : "365"
  279. <odiaeresis>            : "366"
  280. <division>              : "367"
  281. <oslash>                : "370"
  282. <ugrave>                : "371"
  283. <uacute>                : "372"
  284. <ucircumflex>           : "373"
  285. <udiaeresis>            : "374"
  286. <yacute>                : "375"
  287. <thorn>                 : "376"
  288. <ydiaeresis>            : "377"
  289.  
  290.  
  291. -----------------------------------------------------------------------------
  292. Subject: 253)  TOPIC: UIL
  293.  
  294. [NOTE: As you can see, this is a new topic area. Send me your ideas for
  295. answered questions pertaining to this topic.]
  296.  
  297. -----------------------------------------------------------------------------
  298. Subject: 254)  What is UIL and why is it so popular?
  299.  
  300. [Last modified: Sept 94]
  301.  
  302. Answer:
  303.  
  304. UIL is the acronym for "User Interface Language", a Motif standard which
  305. permits separation of the user interface from application code.  UIL is a
  306. textual description of the user interface which is compiled into binary form
  307. called UID ("User Interface Definition") using the Motif-provided compiler
  308. called "uil".
  309.  
  310. It is important to realize that UIL is a static description of the UI in that
  311. connections between buttons and the dialogs they invoke, for example, is not
  312. expressed here; dynamic UI behavior appears in C code.
  313.  
  314. The Period Table of Widgets, called "periodic" (delivered by many Motif
  315. vendors) is an example of a UIL application.
  316.  
  317. There are many advantages and disadvantages of UIL applications.  A few of the
  318. advantages are:
  319.  
  320.     UIL is a standard format which encourages separation of the
  321.     user interface from application code.
  322.  
  323.     UIL can be read and/or written by many of the GUI builders and UIMS
  324.     tools mentioned elsewhere in this FAQ, making your interface portable
  325.     (to a degree) across builder tools.
  326.  
  327.     UIL is a much better language than C for defining a widget
  328.     hierarchy: in C, the widget hierarchy is expressed "linearly"
  329.     by referencing a previously-created parent widget when creating
  330.     a child widget; in UIL, widget trees are defined more naturally
  331.     using nesting.
  332.  
  333.     With UIL, you separate the definition of the widget tree from
  334.     the application.  You can make major changes to the look-and-feel
  335.     without re-building the application.
  336.  
  337.     It is possible to write a "general-purpose" application that defines
  338.     a library of callbacks.  The application may "execute" any UIL file
  339.     that references callbacks from the library.
  340.  
  341.  
  342. For a good UIL reference, see "Motif Programming Manual", Volume 6A, published
  343. by O'Reilly and Associates. [See "BOOKS" for details.]
  344.  
  345. -----------------------------------------------------------------------------
  346. Subject: 255)  What is Mrm?
  347.  
  348. [Last modified: Nov 94]
  349.  
  350. Answer:  Mrm is the "Motif Resource Manager", a set of functions (whose names
  351. begin with Mrm, such as MrmFetchWidget and MrmRegisterNames) in libMrm.a which
  352. retrieve the widget hierarchy from the UID file, associate callbacks, and
  353. create the widgets.
  354.  
  355. Mrm is usually discussed in books which cover UIL.
  356.  
  357.     Motif Programming Manual, Volume 6A
  358.     OSF/Motif Programmers Guide
  359.     OSF/Motif Programmers Reference Manual
  360.  
  361. See the BOOKS section for detailed references.
  362.  
  363. -----------------------------------------------------------------------------
  364. Subject: 256)  How do I specify a search path for ".uid" files?  Answer:  Use
  365. the UIDPATH environment variable.  It is documented on the MrmOpenHierarchy()
  366. man page.
  367.  
  368. -----------------------------------------------------------------------------
  369. Subject: 257)  Can I specify callback functions in resource files?
  370.  
  371. Answer:  To specify callbacks, you must use UIL in addition to or in place of
  372. resource files.  You can, however, specify translations in resource files,
  373. which give you most of the same functionality as callback functions.
  374.  
  375. Ken Lee, http://www.rahul.net/kenton/
  376.  
  377. -----------------------------------------------------------------------------
  378. Subject: 258)  How can I set a multiline label in UIL?
  379.  
  380. [Last modified: Sept 94]
  381.  
  382. Answer:  In UIL, you have to explicitly create a compound string with a
  383. separator.  Here's what W. Scott Meeks suggests:
  384.  
  385. value nl : compound_string('', seperate=true);
  386.  
  387. object my_label : XmLabel
  388. {
  389.     arguments
  390.     {
  391.         XmNlabelString = 'Here' & nl & 'is' & nl & 'the' & nl & 'Label';
  392.     };
  393. };
  394.  
  395.  
  396. -----------------------------------------------------------------------------
  397. Subject: 259)  Is there a program that can convert a UIL file to tclMotif?  I
  398. have an old Motif program that I used on SCO unix. Now that I switched to
  399. Linux, I would like to "reprogram" it without the Motif libraries under Linux.
  400.  
  401. [Last modified: Aug 95]
  402.  
  403. Answer:  Jan Newmarch (jan@ise.canberra.edu.au) writes:
  404.  
  405. The latest version of tclMotif (v 1.3) will allow you to load uil files
  406. (actually, the uid files output from the uil compiler) directly into tclMotif.
  407. So you don't need to convert at all.
  408.  
  409. The source is available at ftp.x.org. This, plus a Linux binary are also at
  410. ftp://ftp.canberra.edu.au/pub/motif/tclMotif (Thanks to Ben Elliston
  411. (ben@ise.canberra.edu.au) for correcting this URL.)
  412.  
  413. -----------------------------------------------------------------------------
  414. Subject: 260)  Why does my SCO UIL application fail to open 60 UID files?
  415.  
  416. [Last modified: Sept 95]
  417.  
  418. Answer:  Make sure that you call MrmCloseHierarchy. There is no need to keep
  419. the file open after you fetch the widgets from it.
  420.  
  421. Thanks to Tom Schutter (tom@platte.com)
  422.  
  423. -----------------------------------------------------------------------------
  424. Subject: 261)  TOPIC: ICONIFICATION and DE-ICONIFICATION
  425.  
  426. Iconification/de-iconification is a co-operative process between a client and
  427. a window manager.  The relevant standards are set by ICCCM.  Mwm is ICCCM
  428. compliant.  The toplevel (non-override-redirect) windows of an application may
  429. be in three states: WithdrawnState (neither the window nor icon visible),
  430. NormalState (the window visible) or IconicState (the icon window or pixmap
  431. visible).  This information is contained in the WM_STATE property but ordinary
  432. clients are not supposed to look at that (its values have not yet been
  433. standardised).  Movement between the three states is standardised by ICCCM.
  434.  
  435. -----------------------------------------------------------------------------
  436. Subject: 262)  How can I keep track of changes to iconic/normal window state?
  437.  
  438. Answer:  You can look at the WM_STATE property, but this breaks ICCCM
  439. guidelines.  ICCCM compliant window managers will map windows in changing them
  440. to normal state and unmap them in changing them to iconic state. Look for
  441. StructureNotify events and check the event type:
  442.  
  443.         XtAddEventHandler (toplevel_widget,
  444.                         StructureNotifyMask,
  445.                         False,
  446.                         StateWatcher,
  447.                         (Opaque) NULL);
  448.         ....
  449.         void StateWatcher (w, unused, event)
  450.         Widget w;
  451.         caddr_t unused;
  452.         XEvent *event;
  453.         {
  454.                 if (event->type == MapNotify)
  455.                         printf ("normal\n");
  456.                 else if (event->type == UnmapNotify)
  457.                         printf ("iconified\n");
  458.                 else    printf ("other event\n");
  459.         }
  460.  
  461.  
  462. If you insist on looking at WM_STATE, here is some code (from Ken Sall) to do
  463. it:
  464.  
  465.         /*
  466.         ------------------------------------------------------------------
  467.         Try a function such as CheckWinMgrState below which returns one of
  468.         IconicState | NormalState | WithdrawnState | NULL :
  469.         ------------------------------------------------------------------
  470.         */
  471.         #define WM_STATE_ELEMENTS 1
  472.  
  473.         unsigned long *CheckWinMgrState (dpy, window)
  474.         Display *dpy;
  475.         Window window;
  476.         {
  477.           unsigned long *property = NULL;
  478.           unsigned long nitems;
  479.           unsigned long leftover;
  480.           Atom xa_WM_STATE, actual_type;
  481.           int actual_format;
  482.           int status;
  483.  
  484.             xa_WM_STATE = XInternAtom (dpy, "WM_STATE", False);
  485.  
  486.             status = XGetWindowProperty (dpy, window,
  487.                           xa_WM_STATE, 0L, WM_STATE_ELEMENTS,
  488.                           False, xa_WM_STATE, &actual_type, &actual_format,
  489.                           &nitems, &leftover, (unsigned char **)&property);
  490.  
  491.             if ( ! ((status == Success) &&
  492.                         (actual_type == xa_WM_STATE) &&
  493.                         (nitems == WM_STATE_ELEMENTS)))
  494.                 {
  495.                 if (property)
  496.                     {
  497.                     XFree ((char *)property);
  498.                     property = NULL;
  499.                     }
  500.                 }
  501.             return (property);
  502.         } /* end CheckWinMgrState */
  503.  
  504.  
  505. One problem with testing WM_STATE is that a race condition is possible;
  506. immediately after testing it, it could change, and the logic proceeds to
  507. behave as if it were in the old state.
  508.  
  509. -----------------------------------------------------------------------------
  510. Subject: 263)  How can I check if my application has come up iconic?  I want
  511. to delay initialization code and other processing.
  512.  
  513. Answer:  Use XtGetValues and check for the XmNinitialState value of the
  514. toplevel shell just before XtMainLoop. -- IconicState is iconic, NormalState
  515. is not iconic.
  516.  
  517.  
  518. -----------------------------------------------------------------------------
  519. Subject: 264)  How can I start my application in iconic state?
  520.  
  521. Answer:  Try this from the command line:
  522.  
  523.         application -iconic
  524.  
  525. Using the resource mechanism, set the resource XmNinitialState to IconicState
  526. of the toplevel shell widget (the one returned from XtInitialise).
  527.  
  528. -----------------------------------------------------------------------------
  529. Subject: 265)  How can an application iconify itself?
  530.  
  531. Answer:  In R4 and later, use the call XIconifyWindow.  Ken Lee
  532. (http://www.rahul.net/kenton/) adds "Set XmNiconic on your shell.  This should
  533. work in X11R6 and later patch levels of X11R5."
  534.  
  535. For R3, send an event to the root window with a type of WM_CHANGE_STATE and
  536. data IconicState.
  537.  
  538.         void
  539.         IconifyMe (dpy, win)
  540.         Display *dpy;
  541.         Window win;     /* toplevel window to iconify */
  542.         {
  543.                 Atom xa_WM_CHANGE_STATE;
  544.                 XClientMessageEvent ev;
  545.  
  546.                 xa_WM_CHANGE_STATE = XInternAtom (dpy,
  547.                                         "WM_CHANGE_STATE", False);
  548.  
  549.                 ev.type = ClientMessage;
  550.                 ev.display = dpy;
  551.                 ev.message_type = xa_WM_CHANGE_STATE;
  552.                 ev.format = 32;
  553.                 ev.data.l[0] = IconicState;
  554.                 ev.window = win;
  555.  
  556.                 XSendEvent (dpy,
  557.                         RootWindow (dpy, DefaultScreen(dpy)),
  558.                         True,
  559.                         (SubstructureRedirectMask | SubstructureNotifyMask),
  560.                         &ev);
  561.                 XFlush (dpy);
  562.         }
  563.  
  564.  
  565. -----------------------------------------------------------------------------
  566. Subject: 266)  How can an application de-iconify itself?
  567.  
  568. Answer:  XMapWindow (XtDisplay (toplevel_widget), XtWindow (toplevel_widget)).
  569.  
  570. -----------------------------------------------------------------------------
  571. Subject: 267)  Why doesn't MWM display an iconify button on my dialog windows?
  572.  
  573. [Last modified: May 95]
  574.  
  575. Answer:  MWM (and some other window managers) does not allow transient windows
  576. to be iconified.  Transients are automatically unmapped when the main shell is
  577. iconified and they are re-mapped when the main shell is restored.  If you do
  578. not want this transient behavior, you should use top a TopLevelShell widget
  579. instead of a XmDialogShell widget for your windows.
  580.  
  581. Ken Lee, http://www.rahul.net/kenton/
  582.  
  583. -----------------------------------------------------------------------------
  584. Subject: 268)  TOPIC: SPECIALIZED WIDGETS
  585.  
  586. [Last modified: Jan 95]
  587.  
  588. This section describes a few specialized widgets people have asked about.  A
  589. _far_ more comprehensive illustrated list is maintained by Richard Offer
  590. (offer@sgi.com).  His list covers these widget categories:
  591.  
  592.         Complete Listing
  593.         Composite Widgets
  594.         Non-Composite Widgets
  595.         Motif 1.1 Compatible
  596.         Motif 1.2 Compatible
  597.         Athena Compatible
  598.         FWF Widget Set
  599.         By Author
  600.         Shareware Widgets
  601.         Commercial Widgets
  602.  
  603. For Richard Offer's Widget FAQ Home Page, WWW users should see:
  604.  
  605.         http://reality.sgi.com/widgetFAQ/
  606.  
  607. The Widget FAQ is also available in ASCII as:
  608.  
  609.         ftp://ftp.x.org/contrib/faqs/Widget.FAQ.Z
  610.  
  611. If you don't have access to the World Wide Web, the Widget FAQ (sans pictures)
  612. can be obtained from ftp.x.org:
  613.  
  614.         /contrib/faqs/Widget.FAQ.Z
  615.  
  616.  
  617. -----------------------------------------------------------------------------
  618. Subject: 269)  Where can I get a Table widget? Matrix widget? Spreadsheet
  619. widget? Tree widget?
  620.  
  621. [Last modified: Nov 96]
  622.  
  623. Answer:  (Microline updated Nov 96.)
  624.  
  625. XRT/table from KL Group allows you to easily display and manipulate tables and
  626. forms in Motif applications. Every feature of the table is accessible through
  627. standard resources. It also supports UIL and C++ interfaces and can be easily
  628. integrated into popular GUI builder tools. It supports compound strings,
  629. widgets in cells, images in cells, spanned cells, PostScript output and
  630. efficient handling of large tables. For more information email info@klg.com or
  631. visit http://www.klg.com/ or contact KL Group Inc., 260 King Street East,
  632. Third floor, Toronto, Ontario Canada M5A 1K3. Phone (800)663-4723 or
  633. (416)594-1026.
  634.  
  635. Microline Software sells a widget library that includes Grid and Tree widgets.
  636. The Microline Widget Library was used to build the Netscape Navigator for
  637. UNIX.  Unlike other tabular widgets, keyboard traversal is intuitive using the
  638. arrow keys, PageUP, PageDown, etc.  It includes advanced features such as cell
  639. spanning, pixmap images in cells, cut/paste, drag/drop (with Motif 1.2), fixed
  640. columns on the top, bottom, left and right a number of selection policies,
  641. interactive row and column sizing, etc.  A free LINUX version is also
  642. available.  Microline is now a division of Neuron Data.  See URL
  643. http://www.neurondata.com/Products/Wl/xml.html for more details and to
  644. download demos. (Microline updated May 97)
  645.  
  646. XbaeMatrix is a Motif widget which presents an editable array of string data
  647. to the user in a scrollable table similar to a spreadsheet. The rows and
  648. columns of the Matrix may optionally be labeled. Also, a number of "fixed"
  649. leading rows or columns may be specified - these behave similarly to the
  650. labels. While XbaeMatrix looks and acts like a grid of XmTextField widgets, it
  651. actually contains only one XmTextField.  This means that XbaeMatrix widgets
  652. with hundreds or thousands of rows have much less overhead than they would if
  653. they used an XmTextField for each cell. XbaeMatrix has callbacks for doing
  654. field validation and customizing traversal. It allows cells to be assigned
  655. independent colors.  It allows rows, columns and regions of cells to be
  656. selected (highlighted).  The matrix can be dynamically grown or shrunk by
  657. adding and deleting rows and columns at any position.
  658.  
  659. For Xbae code and documentation via ftp, see the various files
  660. ftp.x.org:/contrib/widgets/motif/Xbae-*.  Or from the URL:
  661. ftp://ftp.x.org/contrib/widgets/motif/ , get xbae.tgz and Xbae-3.8-*.
  662.  
  663. Kee Hinckley (nazgul@utopia.com) recently informed this FAQ maintainer that he
  664. will put the Table widget on ftp at ftp.utopia.com _approximately_ at the end
  665. of September or early October, 1994. He is in the process of addressing some
  666. issues concerning Motif 1.2 and higher with respect to the Table widget.  The
  667. Widget Creation Library (Wcl) also has a version of the Table widget.
  668.  
  669. Expert Database Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.
  670. Phone: (212) 783-6981
  671.  
  672. has a very comprehensive table widget that uses both Motif scrollbars or a
  673. "virtual" scrollbar showing a miniature version of the entire spreadsheet.
  674. Allows for different width columns, changing colors in each cell.  Only one
  675. X-Window is used so as to reduce the amount of system resources used.  Contact
  676. Ken Jones email:  ken@mr_magoo.sbi.com)
  677.  
  678. -----------------------------------------------------------------------------
  679. Subject: 270)  Where can I get a bar graph widget?
  680.  
  681. [Last modified: Nov 96]
  682.  
  683. Answer:  (Loox added Nov 96) The LOOX dynamic graphics and data visualization
  684. package includes 2D and 3D charting widgets. The 2D Grapher widget can display
  685. up to 30 simultaneous charts of 15 different types, including bar, histogram,
  686. pie, candle-stick, high-open-low-close and others. The widget supports user
  687. interactions, automatic update and scrolling.
  688.  
  689. The 3D grapher widget displays 3 or 4 dimensional data as a surface, 3d bar
  690. chart, isoline or ribbon charts. Features include interactive scale and
  691. rotation of the 3D surface, plus a large number of configurable resources.
  692. Contact:
  693.  
  694.         Loox Software Inc.
  695.         4962 El Camino Real, # 206
  696.         Los Altos, CA 94022
  697.         voice : (415)903-0942
  698.         fax: (415)903-9824
  699.         url: http://www.loox.com
  700.         email: sales@loox.com
  701.  
  702. Answer:  You can fake one by using for each bar a scroll bar or even a label
  703. which changes in size, put inside a container of some kind.
  704.  
  705. Try the StripChart widget in the Athena widget set. Set the XtNupdate resource
  706. to 0 to keep it from automatically updating.
  707.  
  708. The comp.windows.x FAQ mentions a bar graph widget.
  709.  
  710. Expert Database Systems, Inc.  sells a bar graph widget as well as a multi-
  711. line graph with automatic scaling, a 3-D surface graph, and a high/Low graph
  712. with two lines for moving averages.  Contact Ken Jones Expert Database
  713. Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.  Phone: (212)
  714. 783-6981
  715.  
  716.  
  717. The Xtra XWidget library by Graphical Software Technology is no longer
  718. available (as of May, 1995).
  719.  
  720.  
  721. KL Group sells two graphing widgets which both do bar charts. Greg Kiessling
  722. of KL Group writes:
  723.  
  724. XRT/graph displays 2-D data in virtually any type of bar chart, X-Y plot, pie
  725. chart, area graph, financial graph or logarithmic scientific chart.  It has
  726. over 200 resources to fine-tune the graph's appearance and behavior.  Other
  727. features include fast-updates, text areas, 3D-look on bars and pies, time-
  728. axis, user-interaction hooks and a graph builder tool.
  729.  
  730. XRT/3d displays 3-D data in surface plots, contour graphs and bar charts. It
  731. has over 140 resources, and will automatically contour and zone 3-D data using
  732. custom or default distribution tables. Users can automatically rotate, zoom
  733. and scale views. Other features include 4-D graphs, projections, histograms,
  734. text areas and user-interaction hooks.
  735.  
  736. Both XRT/graph and XRT/3d can be programmed using resources, UIL and C++.
  737. They are easily integrated into popular GUI Builder tools. They both support
  738. PostScript output. There are no run-time, distribution or royalty fees for
  739. distributing end-user applications. For more information email info@klg.com or
  740. visit http://www.klg.com/ or contact KL Group Inc., 260 King Street East,
  741. Third floor, Toronto Ontario Canada M5A 1K3. Phone (800)663-4723 or (416)594-
  742. 1026.
  743.  
  744.  
  745. The product Xmath, made by Integrated Systems Inc. is a product which has
  746. interactive 2d and 3d graphics for bar,strip,line,symbol,
  747. surface,contour,etc...also has complete numerics capabilities, an easy to use
  748. debugger, a complete high level language, a spreadsheet, a motif gui access
  749. capability, and much more all created on top of motif.
  750.  
  751. You can either email to xmath-info@isi.com or call (408)980-1500.
  752.  
  753. Digital Equipment Corporation (DEC) provides the following product NetEd: "The
  754. network editor widget is a Motif toolkit conforming widget that applications
  755. can use to express complex interrelationships graphically in the form of
  756. networks or graphs. The network editor supports interactive or application-
  757. controlled creation and editing of directed graphs or networks."
  758.  
  759.  
  760. ACE/gr is an X based XY plotting tool implemented with a point 'n click
  761. paradigm.  A few of its features are:
  762.  
  763.    * Plots up to 10 graphs with 30 data sets per graph.
  764.    * Data read from files and/or pipes.
  765.    * Graph types XY, log-linear, linear-log, log-log, bar,
  766.         stacked bar charts.
  767.  
  768. it is available from
  769.  
  770.         ftp.ccalmr.ogi.edu (presently amb4.ccalmr.ogi.edu)
  771.  
  772. with IP address 129.95.72.34. The XView version (xvgr) will be found in
  773. /CCALMR/pub/acegr/xvgr-2.09.tar.Z and the Motif version (xmgr) in
  774. /CCALMR/pub/acegr/xmgr-2.09.tar.Z.  Comments, suggestions, bug reports to
  775. pturner@amb4.ccalmr.ogi.edu (if mail fails, try pturner@ese.ogi.edu). Due to
  776. time constraints, replies will be few and far between.
  777.  
  778. Caterpillar, Inc. sells the ENGOTS (Engineering Graphic Object Tool Set)
  779. widget set for Motif.  The library includes interactive plotting, built in
  780. units conversion, copy-cut-past, postscript output, ... :
  781.  
  782.  
  783.     XY/contour Plot (configurable to Bar plots)
  784.     XY/contour Strip Charts
  785.     Polar Plot
  786.     Custom Interactive Drawing (using provided Drawing Package)
  787.     float/int data entry (Motif Text "Look and Feel") with range checking
  788.  
  789.  
  790. Contact Paul Mauschbaugh, Caterpillar, Inc. at 309-578-4084 (mush@cat.com) for
  791. more information.
  792.  
  793. -----------------------------------------------------------------------------
  794. Subject: 271)  Is there a graph widget in which you can add vertices and edges
  795. and get automatic updating?
  796.  
  797. [Last modified: March 93]
  798.  
  799. Answer:  The XUG FAQ in comp.windows.x includes information on graph display
  800. widgets.  There is also an implementation in the Asente/Swick book.
  801.  
  802.   From Martin Janzen: "You could have a look at DataViews, from V.I.
  803.    Corporation.  This package is used mainly to display a variety of graph
  804.    drawings (eg. bar, line, pie, high/low, and other charts), and to update
  805.    the graphs as information is received from "data sources" such as files,
  806.    processes (through pipes), or devices.
  807.  
  808.    However, it also provides "node" and "edge" objects which can be used
  809.    when working with network graphs.  The DV-Tools function library
  810.    provides routines which traverse a graph, count visits to each node or
  811.    edge, mark nodes or edges of interest, and so on.  A node or edge object
  812.    can have an associated "geometry object" (such as a symbol or a line),
  813.    which represents that node or edge.
  814.  
  815.    Drawbacks: There's no automatic positioning algorithm; when you add a
  816.    node or edge, you have to create and position its geometry object
  817.    yourself.  Also, this isn't a set of add-on widgets; you can either have
  818.    DataViews create an X window (ie. a separate shell), or you can create
  819.    your own XmDrawingArea and use DataViews to update its window when
  820.    expose events are received.  Finally, the package is quite expensive,
  821.    and there is a run-time charge.
  822.  
  823.    The vendor's address is:
  824.      V.I. Corporation,
  825.      47 Pleasant Street,
  826.      Northampton, MA  01060,
  827.             Email: vi@vicorp.com, Phone: (413) 586-4144, Fax:   (413) 584-2649
  828.  
  829.    or
  830.  
  831.      V.I. Corporation (Europe) Ltd.,
  832.      First Base, Beacontree Plaza,
  833.      Gillette Way,                      Email: viesales@eurovi.uucp
  834.      Reading, Berkshire  RG2 0BP"
  835.    Phone: +44 734 756010,      Fax:   +44 734 756104
  836.  
  837. Craig Timmerman wrote:  Just wanted others to know that there is a third
  838. competitor in what may be come a big market for generic APIs.  The product is
  839. called Open Interface and Neuron Data is the vendor.  Neuron has added some
  840. extra, more complex widgets to their set.  The two most notable are a table
  841. and network widget.  [...]  I believe that the network widget got its name
  842. from its ability to display expert system networks that Neuron's AI tools
  843. needed.  It would be more aptly named the graph widget.  It can display and
  844. manipulate graphs of various types (trees, directed graphs, etc).  Contact is
  845.  
  846.         Neuron Data
  847.         156 University Avenue
  848.         Palo Alto,  CA  94301
  849.         (415) 321-4488
  850.  
  851.  
  852. prism!gt3273b@gatech.edu  (RENALDS,ANDREW THEODORE) posted a set of public
  853. domain routines for graph drawing.  Contact him for a later set.
  854.  
  855. Ramon Santiago (santiago@fgssu1.fgs.slb.com) wrote:  HP has released source
  856. code for XmGraph and XmArc, part of the InterWorks library, which does exactly
  857. this. The sources can be obtained by contacting Dave Shaw,
  858. librarian@iworks.ecn.uiowa.edu. A few trivial source code changes need to be
  859. made to get these widgets to compile under Motif 1.2.
  860.  
  861. Free DAG - directed acyclic graph drawing software in motif environment is
  862. available. Please send a note to address below if you want it:
  863.  
  864. Budak Arpinar, TUBITAK Software Research & Development Center, Ankara,
  865. TURKIYE, E-mail : C51881@TRMETU.BITNET
  866.  
  867.  
  868. -----------------------------------------------------------------------------
  869. Subject: 272)  Is there a help system or Motif hypertext system available?
  870.  
  871. [Last modified: Nov 96]
  872.  
  873. Answer:  There are many hypertext-like help systems.
  874.  
  875. Computer Generation Incorporated's  HView widget displays HTML 2.0 standard
  876. text and images and HTML 3.0 tables. The widget was developed to provide an
  877. imbedded on-line help facility. It offers a light weight, portable, and robust
  878. browser for HTML documents without having to distribute a separate Web Browser
  879. with your applications. A special feature allows links from HTML source files
  880. into arbitrary text files.
  881.  
  882.         http://www.compgen.com/widgets/
  883.         Computer Generation Incorporated
  884.         Building G, 4th Floor
  885.         5775 Peachtree Dunwoody Road
  886.         Atlanta, Georgia 30342 USA
  887.         +1 404 705 2800
  888.         Fax: +1 404 705 2805
  889.  
  890. Other help systems include:
  891.  
  892. Libhelp:  http://www.informatik.uni-
  893. stuttgart.de/ipvr/bv/personen/mache/libhelp/index.html
  894.  
  895. Libhelp is a comprehensive hypertext help system library for OSF/Motif(tm)
  896. applications. It adds a help browser window to OSF/Motif(tm) applications
  897. which can be accessed by a single interface function. It is suitable for menu
  898. help and context sensitive help. Also it can run as a standalone application
  899. (xmhelp).
  900.  
  901. Libhelp documents can be written in HTML (HyperText Markup Language) and can
  902. have hypertext links, different fonts, inlined images and a lot of more
  903. elements known from www (world wide web) browsers. Libhelp implements its own
  904. history, index, caching and search path schemes.
  905.  
  906. Libhelp is a derivative work of NCSA Mosaic(tm) and not the original NCSA
  907. Mosaic(tm) distributed by the University of Illinois and is available for
  908. academic and individual use only. It is NOT available for commercial use.
  909.  
  910. Thanks to Matthew M. Freedman (mattf@cac.washington.edu) for the libhelp
  911. pointer.
  912.  
  913.  
  914. HTML Widget from NCSA:
  915.  
  916. The NCSA Mosaic for X package contains an HTML widget which is freely
  917. available and is the main vehicle for viewing HTML documents in the Mosaic
  918. program. It has callbacks for anchor hits, selections, etc and many many
  919. resources for customizing the viewing area of your hypertext documents.  See
  920. "Where can I get the HTML widget" above.
  921.  
  922. GWHIS:
  923.  
  924. There is a product from Quadralay Corporation, called the Global-Wide Help &
  925. Information Systems (GWHIS).
  926.  
  927. from a press release:  AUSTIN, TX (March 3, 1994) Quadralay Corporation today
  928. announced its newest software development tool, Global Wide Help & Information
  929. System (GWHIS).  GWHIS allows third party application developers to add online
  930. documentation and context sensitive help to their applications like never
  931. before.  This documentation may consist of plain text, rich format text,
  932. hypertext, images, audio, and/or video animation and may easily be distributed
  933. either locally or over a wide area network such as the Internet.
  934.  
  935. GWHIS consists of two primary components.  An application programming
  936. interface (API), and a hypermedia viewer (based on technology licensed from
  937. the NCSA Mosaic project).  Several ancillary conversion programs are also
  938. available allowing end users to easily convert existing documentation into
  939. GWHIS' native HTML format.
  940.  
  941. GWHIS is available on the following platforms: SPARC SunOS 4.1.x, SPARC
  942. Solaris 2.x, INTEL SCO Open Desktop, INTEL Solaris 2.x, HP 9000/700, and the
  943. RS/6000. Support for additional platforms (including MS Windows and Macintosh)
  944. is under consideration.  Fully functional evaluation copies of this software
  945. are available upon request or via anonymous ftp from ftp.quadralay.com.
  946.  
  947. Brian Combs Quadralay Corporation combs@quadralay.com
  948.  
  949.  
  950. Bristol Technology have a hypertext system HyperHelp with the look-and-feel of
  951. Motif.  HyperHelp 4.0 is available now and includes support for MIF, RTF (Word
  952. 6.0) and SGML.  (The OpenLook look-and-feel is no longer supported).
  953.  
  954.         Bristol Technology, Inc.
  955.         241 Ethan Allen Highway
  956.         Ridgefield, CT  06877
  957.         (203) 438-6969 (phone)
  958.         (203) 438-5013 (fax)
  959.         info@bristol.com
  960.  
  961. Demos are available by anonymous ftp from ftp.bristol.com (192.246.192.2) in
  962. /pub/Demos/HyperHelp.
  963.  
  964. There was a posting of a motif hypertext-widget to comp.sources.x (Author:
  965. B.Raoult ( mab@ecmwf.int ) ).  It had the facility to read in helptext from a
  966. file.
  967.  
  968. Francois Felix Ingrand (felix@idefix.laas.fr) wrote:  I have translated the
  969. Info AW (originally written by Jordan Hubbard) to Motif. It is a Widget to
  970. browse Info files (format used by GNU for their various documentations). I use
  971. it as the help system of various tool I wrote. The corrected URL, thanks to
  972. Hal DeVore (hdevore@erehwon.bmc.com), is:
  973.  
  974.         ftp://ftp.laas.fr/pub/ria/felix/prs/xinfo-motif.tar.gz
  975.  
  976.  
  977. Form Scott Raney (raney@metacard.com) MetaCard is a commercial package that
  978. can be used to implement hypertext help.  The text fields support multiple
  979. typefaces, sizes, styles, colors, subscript/superscript, and hypertext links.
  980. It has a Motif interface, and a template for calling it from an Xt/Motif
  981. application is included.  You can FTP a save-disabled distribution from
  982. ftp.metacard.com or from world.std.com.  For more info, email to
  983. info@metacard.com.
  984.  
  985.  
  986. The Motifation GbR also provides a hypertext-helpsystem named 'XpgHelp'.
  987. (Motif look-and-feel / features like those known from MS Windows Help )
  988. Information about XpgHelp and a free demo version can be obtained via:
  989. http://www.uni-paderborn.de/fachbereich/AG/szwillus/xpghelp/index.html
  990.  
  991. XpgHelp is distributed by:
  992.  
  993.            Motifation GbR
  994.            Geroldstrasse 38
  995.            33098 Paderborn
  996.            Germany
  997.            +49 (0) 5251 25633 (phone)
  998.            email: griebel@uni-paderborn.de
  999.  
  1000.  
  1001. XpgHelp has nearly the same features like HyperHelp: (multiple fonts, graphics
  1002. in b&w and color, different styles, tabs, links, short links, notepad, ...)
  1003.  
  1004. The Interface Builder MOTIFATION uses XpgHelp as its hypertext helpsystem.
  1005.  
  1006. -----------------------------------------------------------------------------
  1007. Subject: 273)  Is there a canvas widget or drawing widget for graphical
  1008. display?
  1009.  
  1010. [Last modified: Nov 96]
  1011.  
  1012. Answer:  (Loox added Nov 96) The LOOX dynamic graphics development tool
  1013. includes a Drawing Manager widget for the display of dynamic graphics screens.
  1014. Features include
  1015.  
  1016.  - display of intelligent graphics primitives (polylines, ellipses, pixmaps,
  1017. links)
  1018.  - easy animation, blinking etc of primitives
  1019.  - dynamic control objects (sliders, knobs, dials, toggles, multi-states,
  1020. digital display)
  1021.  - C and C++ APIs
  1022.  - LOOXMaker graphical editor for interactive primitive creation and animation
  1023.  
  1024. Contact:
  1025.  
  1026.         Loox Software Inc.
  1027.         4962 El Camino Real, # 206
  1028.         Los Altos, CA 94022
  1029.         voice : (415)903-0942
  1030.         fax: (415)903-9824
  1031.         url: http://www.loox.com
  1032.         email: sales@loox.com
  1033.  
  1034.  
  1035. Groupe Bull - Koala Project has a Motif Canvas [Knvas] Widget.  This widget is
  1036. intended to provide graphical display (lines, rectangles, icons,...) and
  1037. direct manipulation services (select, move, resize,...) for Xt based
  1038. applications. This widget is intended to be include in a MOTIF application,
  1039. but you can generate an Athena widget (though demos are only using MOTIF). The
  1040. widget is shipped with an objects library based on a C object oriented model
  1041. called KLONE (use of the Xt object model would dramaticaly increase
  1042. application load time and KLONE provides garbage collection).  Features:
  1043.  
  1044. - uses an improved C small object-oriented model (garbage col. + polymorphism)
  1045. - multi-view: an object may be shared between two views (canvases)
  1046. - Multi-display: two views may be on different displays / screens
  1047. - double buffering for smooth animations
  1048. - easy to use "just know how to use widgets"
  1049. - small objects
  1050. - garbage collection
  1051. - Tag object to define graphical object appearance
  1052. - define tag's attributes with Xt resources
  1053. - dispatch mechanism uses Xt -> you can set Xt translations on a graphic obj
  1054. - Interactor objects to define a complete behavior
  1055. - unlimited Zoom / Unzoom
  1056. - classes: Line, Rect, Filled rect, Xpm Icon, Group, Ellipse, Anchor, Link
  1057. - mouse interactors: select, move, resize
  1058.  
  1059. More info available at:
  1060.  
  1061.         http://www.inria.fr/koala/jml/widgets/knvas.html
  1062.         ftp://avahi.inria.fr/pub/widgets/knvas-1.13.2.tar.gz
  1063.  
  1064. Requirements: MOTIF, XPM
  1065.  
  1066. Thanks to Jean-Michel.Leon@sophia.inria.fr.  Thanks to Joachim Fabini
  1067. (jo@vmars.tuwien.ac.at) for updating me on the name change from "canvas" to
  1068. "knvas" and the version change.
  1069.  
  1070. -----------------------------------------------------------------------------
  1071. Subject: 274)  How can I create a transparent widget?
  1072.  
  1073. [Last modified: June 95]
  1074.  
  1075. Answer:  The simplest way is probably to use the SHAPE protocol extension.
  1076. The xeyes, xlogo, and oclock demo programs in X11R5 (and later) are good
  1077.  
  1078.  
  1079.                                     - 12 -
  1080.  
  1081.  
  1082. examples of using SHAPE with widgets. You should be able to use the same
  1083. techniques with your Motif widget subclasses.
  1084.  
  1085. Ken Lee, http://www.rahul.net/kenton/
  1086.  
  1087. Ken Sall (ksall@cen.com) adds: The official name for this extension is "X11
  1088. Nonrectangular Window Shape Extension". If you have X11R5 source, the Shape
  1089. extension document is $TOP/mit/hardcopy/extensions/shape.PS or
  1090. $TOP/mit/doc/extensions/shape.ms. In X11R6, see
  1091. $TOP/xc/doc/hardcopy/Xext/shape.PS or $TOP/xc/doc/specs/Xext/shape.ms.  There
  1092. is also a terse man page: $TOP/mit/man/Xext/XShape.man (X11R5) and
  1093. $TOP/xc/doc/man/Xext/XShape.man (X11R6).
  1094.  
  1095. -----------------------------------------------------------------------------
  1096. Subject: 275)  TOPIC: CREATING WIDGETS
  1097.  
  1098. [This section is for widget writers.]
  1099.  
  1100. -----------------------------------------------------------------------------
  1101. Subject: 276)  What are some good references for creating widgets (subclassing
  1102. widgets)?
  1103.  
  1104. [Last modified: Feb 95]
  1105.  
  1106. Answer:  Ken Sall (ksall@cen.com) writes:
  1107.  
  1108. If you have Motif 2.0, see the new document provided by OSF called "OSF/Motif
  1109. Widget Writer's Guide" in the directory:  doc/widgetGuide/Output/draft/ps.
  1110.  
  1111. If you have Motif 1.*, try these references (details in the BOOKS topic):
  1112.  
  1113.     Asente, Paul J., and Swick, Ralph R.,
  1114.     X Window System Toolkit, The Complete Programmer's Guide and Specification.
  1115.  
  1116.     Nye, Adrian & O'Reilly, Tim,
  1117.     X Toolkit Intrinsics Programming Manual.Motif Edition, Volume 4M
  1118.  
  1119.     Flanagan, David, Editor,
  1120.     X Toolkit Intrinsics Reference Manual, Volume 5
  1121.  
  1122.  
  1123. Alex Fridman (alex@genlogic.com) writes:
  1124.  
  1125. For graphical widgets, you may try the Generic Logic Toolkit (GLG Widgets). It
  1126. allows custom graphical widgets (such as Graphs and Controls) to be created
  1127. interactively from the supplied templates using the GLG 3D Graphical Editor. A
  1128. Demo is available by ftp from:
  1129.  
  1130.    ftp://ftp.netcom.com/pub/glg/
  1131.  
  1132. David Suller of Generic Logic, Inc. adds:
  1133.  
  1134. When used in an application, a GLG Widget may be animated with real-time data
  1135. via the resource mechanism or used as a graphical server receiving and
  1136. displaying data from several local or remote processes using the built-in
  1137. Inter-Client Communication Server.
  1138.  
  1139. David Suller                  phone:  (617)254-4153
  1140. Generic Logic, Inc.           FAX:    (617) 254-2746
  1141. P.O. Box 35606                email:  glg@genlogic.com
  1142. Brighton, MA 02135-0006       ftp:    ftp.netcom.com:/pub/glg/
  1143.  
  1144.  
  1145. joe shelby (jshelby@autometric.com) writes:
  1146.  
  1147. Alastair Gourlay (alastair.gourlay@eng.sun.com), a member of the technical
  1148. staff at Sun Microsystems and a former member of the Motif Development group
  1149. at OSF, has written 2 articles for _The X Resource_, published by O'Reilly and
  1150. Associates.
  1151.  
  1152. The first, "Writing Motif Widgets : A Pragmatic Approach" can be found in
  1153. Issue 6.  It covers writing a XmPrimitive-derived widget, deriving from that
  1154. widget, and writing a XmManager-derived widget.  Also included are brief
  1155. summaries of several _Xm private functions for widget writers, how to use the
  1156. Motif 1.2 Representation Type functions, and adding the widgets to Mrm/Uil.
  1157.  
  1158. The second, "The One-Minute Manager : Custom Motif Layout Widgets Made Easy"
  1159. can be found in Issue 10.  It expands and greatly simplifies creating
  1160. composite widgets for Motif.  Gourlay has created and released a new widget,
  1161. the XmpGeometry widget that handles all of the geometry management issues for
  1162. you and provides convenience functions for determiningparent and child
  1163. widgets' perfered sizes.  All the programmer has to do to derive from this
  1164. widget is create the new resources and constraints and implement 2 new class
  1165. methods to override the XmpGeometry's methods.  Included with the XmpGeometry
  1166. class are 3 example derived widgets.
  1167.  
  1168. The code for these widgets is available at
  1169.  
  1170. ftp://ftp.uu.net/published/oreilly/xresource/issue6/Subclassing.tar.Z
  1171. ftp://ftp.uu.net/published/oreilly/xresource/issue10/OneMinuteManagers.tar.Z
  1172.  
  1173. Donald L. McMinds and Joseph P. Whitty have written a book, _Writing Your Own
  1174. OSF/Motif Widgets_, published by Prentice Hall for Hewlett-Packard
  1175. Professional Books.  Both authors work at HP's Workstation Systems Division,
  1176. and have been involved with Motif developement since its beginnings.  The book
  1177. (which is mostly code with explanations) gives details on writing
  1178. XmPrimitive-derived, XmManager-derived, and XmGadget-derived widgets, with one
  1179. example widget for each.  In addition, the book provides "man-pages" for
  1180. several _Xm private functions for programmer convenience.
  1181.  
  1182. The code for these widgets is available at
  1183.  
  1184.         ftp://hpcvaal.cv.hp.com/readonly/book_files/wr_widgets.tar.Z
  1185.  
  1186. -----------------------------------------------------------------------------
  1187. Subject: 277)  How can I achieve binary compatibility using the
  1188. XmResolvePartOffset API?
  1189.  
  1190. [Last modified: July 96]
  1191.  
  1192. Answer:  Daniel Dardailler (daniel@x.org) recently provided the following URL:
  1193.  
  1194.         http://www.x.org/people/daniel/xmresolve
  1195.         Achieving Binary Compatibility using the XmResolvePartOffset API
  1196.  
  1197. which addresses the problem caused by the fact that many widget writers "never
  1198. used the XmResolvePartOffsets API in their subclass code, therefore ensuring
  1199. it will break when dynamically relinked with newer version of libXm".
  1200.  
  1201. -----------------------------------------------------------------------------
  1202. Subject: 278)  TOPIC: MISCELLANEOUS
  1203.  
  1204. -----------------------------------------------------------------------------
  1205. Subject: 279)  How can an application be informed of signals?
  1206.  
  1207. [Last modified: Mar 96]
  1208.  
  1209. Answer:  The answer differs depending on whether you're using X11R5 or X11R6.
  1210. For those using X11R6, Ken Lee (http://www.rahul.net/kenton/) writes:  In
  1211. X11R6, the Xt library has the new XtAppAddSignal() function. Ken Lee's
  1212. December, 1995 *The X Advisor* column has an example:
  1213.  
  1214.     http://www.unx.com/DD/advisor/docs/dec95/dec95.klee.shtml
  1215.  
  1216. For those using X11R5, these older responses apply:
  1217.  
  1218. blackman@hodgkin.med.upenn.edu (David Blackman) writes:
  1219.  
  1220. According to comp.windows.x FAQ, you shouldn't make Xt/Xlib calls from a Unix
  1221. signal handler:
  1222.  
  1223.     "You can work around the problem by setting a flag in the
  1224.     interrupt handler and later checking it with a work procedure
  1225.     or a timer event which has previously been added."
  1226.  
  1227. Kaleb KEITHLEY (fedora.x.org!kaleb) adds:
  1228.  
  1229. Xt is not reentrant and it is not safe to call any Xt functions from a signal
  1230. handler...  I think [the signaling] technique is covered in the [X] FAQ. On
  1231. most POSIX-type systems write(2) is guaranteed to be reentrant and atomic. If
  1232. you establish a simple pipe with the pipe(2) system call, and add it as an
  1233. XtInput with XtAppAddInput(), then you can write to the pipe in the signal
  1234. handler. Xt will notice that input is available and call the input-handler
  1235. proc. This technique is inherently better than setting the flag because the
  1236. write to the pipe will result in XtAppNextEvent returning immediately without
  1237. the latency you observe in using the flag technique.  In R6 you can use the
  1238. XtAppAddSignal function.
  1239.  
  1240. Ken Sall (ksall@cen.com) adds:  See the "Signal Handling" chapter of "Motif
  1241. Programming Manual" by Heller and Ferguson, listed in the BOOKS topic.
  1242.  
  1243. Paul Davey (pd@uit.co.uk) adds:  The write and XtAppAddInput input method is
  1244. often the best - but be warned it does not work on some SVR3 based Unixes,
  1245. where a pipe may not be selected on. SCO Unix exhibits this behaviour so here
  1246. the external flag method should be used.
  1247.  
  1248. -----------------------------------------------------------------------------
  1249. Subject: 280)  How do I control the repeat rate on a SUN keyboard?
  1250.  
  1251. Answer:
  1252.  
  1253.      [...]
  1254.  
  1255.      -ar1 milliseconds
  1256.              This option specifies amount of time in milliseconds
  1257.              before   which   a   pressed  key  should  begin  to
  1258.              autorepeat.
  1259.  
  1260.      -ar2 milliseconds
  1261.              This option specifies the interval  in  milliseconds
  1262.              between autorepeats of pressed keys.
  1263.  
  1264. Of course this presumes you're using a server based on the MIT sample server.
  1265.  
  1266. Thanks to kaleb@x.org (Kaleb Keithley)
  1267.  
  1268. -----------------------------------------------------------------------------
  1269. Subject: 281)  How can I identify the children of a manager widget?
  1270.  
  1271. Answer:  Use XtGetValues() on XmNchildren (array of widget IDs) and
  1272. XmNnumChildren (number of widgets in array).
  1273.  
  1274. -----------------------------------------------------------------------------
  1275. Subject: 282)  What functions can an application use to change the size or
  1276. position of a widget?
  1277.  
  1278. Answer:  Applications should set the values of the XmNx, XmNy, XmNwidth, and
  1279. XmNheight resources.
  1280.  
  1281. Note that many manager widgets ignore the XmNx and XmNy resources of their
  1282. children, relying instead on their internal layout algorithms.  If you really
  1283. want specific positions, you must use a manager widget that allows them, e.g.,
  1284. XmBulletinBoard.
  1285.  
  1286. Also note that some manager widgets reject size change requests from their
  1287. children when certain resources are set (e.g., XmNresizable on XmForm).
  1288. Others allow the the children to resize, but clip the results (e.g.,
  1289. XmNallowShellResize on shell widgets).  Make sure you have these resources set
  1290. to the policy you want.
  1291.  
  1292. Due to bugs, some widgets (third party widgets) do not respond to changes in
  1293. their width and height.  Sometimes, you can get them to respond correctly by
  1294. unmanaging them, setting the resources, then managing them again.
  1295.  
  1296. Under no circumstances should applications use routines like
  1297. XtConfigureWidget() or XtResizeWidget().  These routines are reserved for
  1298. widget internals and will seriously confuse many widgets.
  1299.  
  1300. Ken Lee, http://www.rahul.net/kenton/
  1301.  
  1302. -----------------------------------------------------------------------------
  1303. Subject: 283)  Can I use XtAddTimeOut, XtAddWorkProc, and XtAddInput with
  1304. XtAppMainLoop?
  1305.  
  1306. Answer:  On many systems, the obsolete XtAdd*() functions are not compatible
  1307. with the XtAppMainLoop().  Instead, you should use newer XtAppAddTimeOut(),
  1308. XtAppAddWorkProc(), and XtAppAddInput() functions with XtAppMainLoop()
  1309.  
  1310. Ken Lee, http://www.rahul.net/kenton/
  1311.  
  1312. -----------------------------------------------------------------------------
  1313. Subject: 284)  Why does XtGetValues for XmNx and XmNwidth return extremely
  1314. large values?
  1315.  
  1316. Answer:  You must use the 16 bit "Dimension" and "Position" data types for
  1317. your arguments.  If you use 32 bit integers, some implementations will fill
  1318. the remaining 16 bits with invalid data, causing incorrect return values.  The
  1319. *Motif Programmer's Manual* and the widget man pages specify the correct data
  1320. type for each resource.
  1321.  
  1322. Ken Lee, http://www.rahul.net/kenton/
  1323.  
  1324. -----------------------------------------------------------------------------
  1325. Subject: 285)  Can I use XmGetPixmap() with widgets that have non-default
  1326. visual types?
  1327.  
  1328. Answer:  XmGetPixmap() assumes that you are using the default screen depth.
  1329. If you're using a different depth, use XmGetPixmapByDepth() instead.
  1330.  
  1331. Ken Lee, http://www.rahul.net/kenton/
  1332.  
  1333.  
  1334. -----------------------------------------------------------------------------
  1335. Subject: 286)  What is the matter with Frame in Motif 1.2?
  1336.  
  1337. [Last modified: November 92]
  1338.  
  1339. Answer:  This announcement has been made by OSF:
  1340.  
  1341. "IMPORTANT NOTICE
  1342.  
  1343. We have discovered two problems in the new 1.2 child alignment resources in
  1344. XmFrame. Because some vendors may have committed, or are soon to commit to
  1345. field releases of Motif 1.2 and 1.2.1, OSF's options for fixing them are
  1346. limited. We are trying to deal with these in a way that does not cause
  1347. hardship for application developers who will develop applications against
  1348. various point versions of Motif. OSF's future actions for correction are
  1349. summarized.
  1350.  
  1351. WHAT YOU SHOULD DO AND KNOW
  1352.  
  1353. 1. Mark the following change in your documentation.
  1354.  
  1355. On page 1-512 of the OSF/Motif Programmer's Reference, change the descriptions
  1356. under XmNchildVerticalAlignment as follows (what follows is the CORRECT
  1357. wording to match the current implementation):
  1358.  
  1359. XmALIGNMENT_WIDGET_TOP
  1360.         Causes the BOTTOM edge of the title area to align
  1361.         vertically with the top shadow of the Frame.
  1362.  
  1363. XmALIGNMENT_WIDGET_BOTTOM
  1364.         Causes the TOP edge of the title area to align
  1365.         vertically with the top shadow of the Frame.
  1366.  
  1367. 2. Note the following limitation on resource converters for Motif 1.2 and
  1368. 1.2.1 implementations.
  1369.  
  1370. The rep types for XmFrame's XmNentryVerticalAlignment resource were
  1371. incorrected implemented, which means that converters will not work properly.
  1372. The following resource settings will not work from a resource file in 1.2 and
  1373. 1.2.1:
  1374.  
  1375.         *childVerticalAlignment: alignment_baseline_bottom
  1376.         *childVerticalAlignment: alignment_baseline_top
  1377.         *childVerticalAlignment: alignment_widget_bottom
  1378.         *childVerticalAlignment: alignment_widget_top
  1379.  
  1380. If you wish to set these values for these resources (note they are new
  1381. constraint resources in XmFrame) you will have to set them directly in C or
  1382. via uil.
  1383.  
  1384. WHAT WE WILL DO
  1385.  
  1386. The problem described in note #1 above will not be fixed in the OSF/Motif
  1387. implementation until the next MAJOR release of Motif.  At that time we will
  1388. correct the documentation and modify the code to match those new descriptions,
  1389. but we will preserve the existing enumerated values and their behavior for
  1390. backward compatibility for that release.
  1391.  
  1392. The fix for the problem described in note #2 will be shipped by OSF in Motif
  1393. 1.2.2.
  1394.  
  1395. SUMMARY
  1396.  
  1397. We are sorry for any difficulty this causes Motif users.  If you have any
  1398. questions or flames (I suppose I deserve it) please send them directly to me.
  1399. We sincerely hope this proactive response is better for our customers than you
  1400. having to figure it out yourselves!
  1401.  
  1402. Libby
  1403.  
  1404.  
  1405. -----------------------------------------------------------------------------
  1406. Subject: 287)  What is IMUG and how do I join it?
  1407.  
  1408. [Last modified: July 96]
  1409.  
  1410. Answer:  CAUTION: As of March, 1996, IMUG could not be contacted. If anyone is
  1411. aware of the status of IMUG, please send mail to me (ksall@cen.com).  Thanks
  1412. to Lou Farho (farho@harris.com) for this update.
  1413.  
  1414. IMUG is the International Motif User Group founded by Quest Windows
  1415. Corporation and co-sponsored by FedUNIX.  IMUG is a non-profit organization
  1416. working to keep users informed on technical and standards issues, to
  1417. strengthen user groups on a local level, to increase communication among users
  1418. internationally, and to promote the use of an international conference as a
  1419. forum for sharing and learning more about Motif.  You can join it by
  1420.  
  1421.  1.  Pay the annual membership fee of $20 USD directly to IMUG.  Contact
  1422.  
  1423.      IMUG
  1424.      5200 Great America Parkway
  1425.      Santa Clara,  CA  95054
  1426.      (408) 496-1900
  1427.      imug@quest.com
  1428.  
  1429.  2.  Register at the International Motif User Conference, and automatically
  1430.      become an IMUG member.
  1431.  
  1432.  3.  Donate a pd widget, widget tool or widget builder to the IMUG Widget
  1433.      Depository and receive a free one year IMUG membership.
  1434.  
  1435. -----------------------------------------------------------------------------
  1436. Subject: 288)  How do I set the title of a top level window?
  1437.  
  1438. [Last modified: September 92]
  1439.  
  1440. Answer:  Set XmNtitle (and optionally XmNtitleEncoding) for TopLevelShells.
  1441. (Note that this is of type String rather than XmStrin.)  Ypu can also set
  1442. XmNiconName if you want its icon to show this title.  For XmDialogShells, set
  1443. the XmNdialogTitle of its immediate child, assuming it's a BulletinBoard
  1444. subclass.  These can also be set in resource files.
  1445.  
  1446. -----------------------------------------------------------------------------
  1447. Subject: 289)  How can I disable the color scheme mechanism in CDE or HP VUE?
  1448.  
  1449. [Last modified: May 97]
  1450.  
  1451. Answer:  Put this in your app-defaults file:
  1452.     *useColorObj: False
  1453.  
  1454. Ken Lee, http://www.rahul.net/kenton/
  1455.  
  1456. -----------------------------------------------------------------------------
  1457. Subject: 290)  Can I use editres with Motif? Is there an editres tutorial?
  1458.  
  1459. [Last modified: Mar 96]
  1460.  
  1461. Answer:  Editres, part of the MIT delivery, is a powerful widget tree analysis
  1462. tool and is highly recommended.  There's negligible overhead in making editres
  1463. available to an application and many projects keep the editres "hook" active
  1464. even for operational programs.
  1465.  
  1466. It isn't built in to Motif (at 1.2.*), but you can do this in your
  1467. application:
  1468.  
  1469.     #include <X11/Xmu/Editres.h>
  1470.     ...
  1471.     XtAddEventHandler(shell_widget, (EventMask) 0, True,
  1472.                       (XtEventHandler) _XEditResCheckMessages, NULL);
  1473.  
  1474. once for each shell widget that you want to react to the "click to select
  1475. client" protocol.  Then link your client with the R5 libXmu.
  1476.  
  1477. Thanks to David Brooks, OSF, for the original answer.  Jan Sandquist
  1478. (ehsjasa@ehs.ericsson.se) supplied the current code snipet above. Joachim
  1479. Fabini (jo@vmars.tuwien.ac.at) suggested that I remove the older use of
  1480. "extern void _XEditResCheckMessages()" which resulted in core dumps on some
  1481. platforms.
  1482.  
  1483. NOTE: Ken Lee has placed his November, 1994 editres tutorial on the Web:
  1484.  
  1485.         http://www.rahul.net/kenton/editres.html.
  1486.  
  1487. -----------------------------------------------------------------------------
  1488. Subject: 291)  Where is the editres protocol documented?
  1489.  
  1490. [Last modified: Apr 95]
  1491.  
  1492. Answer:  In /usr/include/X11/Xmu/EditresP.h.
  1493.  
  1494. Ken Lee, http://www.rahul.net/kenton/
  1495.  
  1496. -----------------------------------------------------------------------------
  1497. Subject: 292)  Why does an augment translation appear to act as replace for
  1498. some widgets?  When I use either augment or override translations in
  1499. .Xdefaults it seems to act as replace in both Motif 1.0 and 1.1
  1500.  
  1501. Answer:  By default, the translation table is NULL.  If there is nothing
  1502. specified (either in resource file, or in args), the widget's Initialize
  1503. finds: Oh, there is NULL in translations, lets use our default ones.  If,
  1504. however, the translations have become non-NULL, the default translations are
  1505. NOT used at all. Thus, using #augment, #override or a new table has identical
  1506. effect: defines the new translations. The only way you can augment/override
  1507. Motif's default translations is AFTER Initialize, using XtSetValues.  Note,
  1508. however, that Motif managers do play with translation tables as well ... so
  1509. that results are not always easy to predict.
  1510.  
  1511. OSF wrote:  A number of people have complained about not being able to
  1512. augment/override translations from the .Xdefaults.  This is due to the
  1513. complexity of the menu system/keyboard traversal and the necessary
  1514. translations changes required to support the Motif Style Guide in menus.  It
  1515. cannot be fixed in a simple way. Fixing it requires re-design of the
  1516. menus/buttons and it is planned to be fixed in 1.2.
  1517.  
  1518. -----------------------------------------------------------------------------
  1519. Subject: 293)  How do you "grey" out a widget so that it cannot be activated?
  1520.  
  1521. Answer:  Use XtSetSensitive(widget, False). Do not set the XmNsensitive
  1522. resource directly yourself (by XtSetValues) since the widget may need to talk
  1523. to parents first.
  1524.  
  1525. -----------------------------------------------------------------------------
  1526. Subject: 294)  Can I change the graphics drawn by insensitive widgets?  Some
  1527. become very difficult to read.
  1528.  
  1529. [Last modified: Aug 97]
  1530.  
  1531. Answer:  There is no general mechanism for this; each widget chooses its own
  1532. insensitive graphics.  Some are customizable, however.  Label and button
  1533. widgets have a XmNlabelInsensitivePixmap resource.  Others, such as the text
  1534. widgets, have an XmNeditable resource; setting this to false is similar to
  1535. insensitive, except tha the graphics do not change.
  1536.  
  1537. Other possibilities would be to install an empty translation table to ignore
  1538. input or to create an occluding InputOnly window to block input.
  1539.  
  1540. -----------------------------------------------------------------------------
  1541. END OF PART EIGHT
  1542.