home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / ui-builders / TeleUSE
Encoding:
Internet Message Format  |  1997-03-19  |  38.3 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!panix!news.mathworks.com!newsfeed.internetmci.com!news.jaguNET.com!not-for-mail
  2. From: mahesh@jaguNET.com (B.G. Mahesh)
  3. Newsgroups: comp.windows.ui-builders.teleuse,comp.windows.x,comp.windows.x.motif,comp.answers,news.answers
  4. Subject: FAQ: TeleUSE GUI Builder
  5. Followup-To: comp.windows.ui-builders.teleuse
  6. Date: 18 Mar 1997 11:16:28 -0500
  7. Organization: Sheetal, Inc.
  8. Lines: 988
  9. Approved: news-answers-request@MIT.EDU
  10. Distribution: inet
  11. Message-ID: <5gmf4s$occ@shado.jaguNET.com>
  12. Reply-To: mahesh@mahesh.com
  13. NNTP-Posting-Host: shado.jagunet.com
  14. Summary: Frequently Asked questions for TeleUSE GUI Builder
  15. Keywords: FAQ TeleUSE Motif GUI Builder
  16. Xref: senator-bedfellow.mit.edu comp.windows.ui-builders.teleuse:401 comp.windows.x:114851 comp.windows.x.motif:56720 comp.answers:24941 news.answers:97513
  17.  
  18. Archive-name: ui-builders/TeleUSE
  19. Last-Modified: March 18, 1997  
  20.  
  21. CVS Version: $Id: TeleUSE.FAQ,v 1.2 1997/03/18 16:15:45 mahesh Exp $
  22.  
  23. Welcome to TeleUSE GUI Builder FAQ :-)
  24.  
  25. Currently the FAQ is being maintained by B.G. Mahesh [mahesh@mahesh.com]
  26.  
  27. Frequency: This will be posted on the first of every month on
  28.            comp.windows.x, comp.windows.x.motif,
  29.            comp.windows.ui-builders.teleuse and the TeleUSE mailing list.
  30.  
  31. Individuals are encouraged to submit corrections, questions and answers
  32. to mahesh@mahesh.com directly.  In many answers below, submitters are
  33. noted in parentheses at the beginning of comments.  (Comments may be
  34. slightly edited.)
  35.  
  36. Myself and all contributors claim no responsibility for the accuracy 
  37. of the information in the FAQ. The FAQ is not meant to be specific technical 
  38. advice. It is only a starting point. I am not responsible for the
  39. material you read on all the links on this page. 
  40.  
  41. Many FAQs, including this one, are available via FTP on the archive site
  42. rtfm.mit.edu in the directory pub/usenet/news.answers/ui-builders. 
  43. To get this FAQ by E-mail, you should send a message to 
  44. mail-server@rtfm.mit.edu with
  45.         send usenet/news.answers/ui-builders/TeleUSE
  46. in the body of the message. Make sure you don't have a signature 
  47. in body of the message.
  48.  
  49. The ASCII version of the FAQ can be downloaded from 
  50. rtfm.mit.edu:pub/usenet/news.answers/ui-builders/TeleUSE
  51.  
  52. The HTML version of the FAQ can be accessed from 
  53. http://www.mahesh.com/TeleUSE/faq.html
  54.  
  55. This article includes answers to the following questions. Questions
  56. marked with a + indicate questions new to this issue; those with
  57. significant changes of content since the last issue are
  58. marked by *:
  59.  
  60.             Table of Contents
  61.             -----------------
  62.  
  63. Q: What is TeleUSE ?
  64. Q: Where can I get the product information from?
  65. *Q: Is there a TeleUSE mailing list? If so, how do I subscribe to
  66.    this list?
  67. Q: Is there a TeleUSE Usenet newsgroup?
  68. Q: What other FAQs should I refer to ?
  69. Q: On what platforms is TeleUSE available?
  70. Q: To what other platforms is Thomson planning to port TeleUSE?
  71. Q: Does TeleUSE generate C and/or C++ ?
  72. Q  Does TeleUSE generate Ada?
  73. Q: Do I need the TeleUSE library to execute an application?
  74. Q: Is there a D-mode for emacs/lemacs/xemacs ?
  75. Q: What versions of Motif do I need to use with TeleUSE?
  76. Q: When I call "create widget" in D using the optional parameters for
  77.    another display and screen, the widgets appear on my default 
  78.    display/screen. How can I get "create widget" to create widgets on 
  79.    another display?
  80. Q: In an attribute window, what is the meaning of a gray setting
  81.    marker ?
  82. Q: Does VIP allow you to add comments to a particular template ?
  83.    If so, how?
  84. Q: What is the purpose of a user-defined attribute ?
  85. Q: How do you use the Drag-On box? What is the purpose of the Drag-On
  86.    box in the value windows (colors, pixmaps, fonts) ?
  87. Q: What is a D event field? How can it be accessed in D ?
  88. Q: What is the difference between a Devent and a rule?
  89. Q: Why is it that the Devents attached to my "createCallback" attributes
  90.    aren't always sent?
  91. Q: Where can you look up the widget class specific pre-defined event
  92.    fields ?
  93. Q: What is the scope of a D event field for a given D event?
  94. Q: If there is no callback available for a particular event of interest,
  95.    how can we attach a D event to it?
  96. Q: What are the valid UDA types that I can define?
  97. Q: Is there a way in d-code to check for the existence of 
  98.     a user-defined attribute before accessing it ?
  99. Q: How to access an UDA in C?
  100. Q: How do I send a D event from C ?
  101. Q: Can any C routine be called from D ? What are the limitations?
  102. Q: What is the purpose of the 'opaque' type?
  103. Q: Are type conversions in D the same as type casting in C ?
  104. Q: Is it possible to declare a D event that is global across more than one
  105.    D modules ? 
  106. Q: Is it possible to declare a D variable that is global across more than
  107.    one D module?
  108. Q: What 3 things must be true in order for a widget to be visible ?
  109. Q: What does AIM stand for?
  110. Q: How can the UI builder generate AIM file?
  111. Q: What does uxb guess do?
  112. Q: If I have a string in the uxb.conf file that matches my platform
  113.    name such as 'sun', uxb does not accept it.  How can I get around
  114.    this?
  115. Q: What is the difference between 'c' and 'pure-c' mode ?
  116. Q: What is the difference between LANGUAGE C and LANGUAGE KRC ?
  117. Q: How can I allow for the ehdb file to be in another directory
  118.    besides the current working directory?
  119. Q: If I have a string in D that represents the name of a D event,
  120.    how can I send the D event?
  121. Q: Can I use the string_list operators directly on a C global
  122.    variable of type 'char **'?
  123. Q: How can I set resources on the eht help windows?
  124. Q: When I try to turn off the file list in the XmFileSelectionBox
  125.    by setting 'showList' to false, I get an empty square window in the
  126.    upper left corner of the FileSelectionBox.  How can I remove it?
  127. Q: When I set the background color on a ScrolledWindow, I still
  128.    can see the default color in some areas of the ScrolledWindow.
  129.    Especially when the contents of the ScrolledWindow do not fill the
  130.    ScrolledWindow.  How can I set the whole ScrolledWindow's background?
  131. Q How can I specify the geometry of an application from the command-line?
  132.    When I use the -geometry option with a TeleUSE generated application
  133.    (e.g., <app> -geometry 600x800+50+50), the option is ignored.
  134. Q: Which 3rd party widgets have been integrated with TeleUSE?
  135. Q: Can I use the xm_string_list operations directly on the
  136.    resources of the XmList ?
  137.  
  138.                    Questions & Answers
  139.                    -------------------
  140.  
  141.  
  142. Q: What is TeleUSE ?
  143. A: [From B.G. Mahesh, mahesh@mahesh.com]
  144.    TeleUSE is a true UIMS (User Interface Management System).
  145.    A UIMS is designed to manage the graphical user interface
  146.    efficiently during the life cycle of an application. TeleUSE
  147.    is one of the leading Motif GUI builders in the industry today.
  148.  
  149. Q: Where can I get the product information from?
  150. A: [From Marianne Worley, mworley@thomsoft.com]
  151.  
  152.    Marianne Worley
  153.    Aonix (formally Thomson Software Products)
  154.    10251 Vista Sorrento Parkway, Suite 300
  155.    San Diego, CA  92121
  156.    Tel:  619-457-2700 x244
  157.    Fax:  619-452-2117
  158.    E-mail:  guiinfo@thomsoft.com
  159.    Web:  http://www.aonix.com
  160.  
  161. *Q: Is there a TeleUSE mailing list? If so, how do I subscribe to
  162.    this list?
  163. A: [From B.G. Mahesh, mahesh@mahesh.com]
  164.    Yes, there is a TeleUSE mailing list. Send an email to
  165.    TeleUSErs-request@sd.aonix.com with the Subject set to
  166.    "subscribe your_email_address". Contributions to the mailing
  167.    list should be sent to newtu@sd.aonix.com
  168.  
  169. Q: Is there a TeleUSE Usenet newsgroup?
  170. A: [From B.G. Mahesh, mahesh@mahesh.com]
  171.    Yes. The name of the group is comp.windows.ui-builders.teleuse
  172.    
  173.  
  174. Q: What other FAQs should I refer to ?
  175. A: [From B.G. Mahesh, mahesh@mahesh.com]
  176.  
  177.    Subject: X windows      
  178.    FTP    : rtfm.mit.edu:pub/usenet/news.answers/x-faq
  179.    URL    : http://www.cis.ohio-state.edu/hypertext/faq/usenet/x-faq/top.html
  180.  
  181.    Subject: Motif
  182.    FTP    : ftp://ftp.cen.com/pub/Motif-FAQ
  183.    URL    : http://www.cis.ohio-state.edu/hypertext/faq/usenet/motif-faq/top.html
  184.    MW3: Motif on the World Wide Web     http://www.cen.com/mw3/
  185.  
  186.  
  187. Q: On what platforms is TeleUSE available?
  188. A: [From Rhoda, rhoda@thomsoft.com]
  189.  
  190.    ----------------------------------------------------------------
  191.     Platform                    OS version          TeleUSE version
  192.    ----------------------------------------------------------------
  193.  
  194.     DecAlpha AXP 3000/500        OSF1 v3.2             3.0.2
  195.     DecAlpha AXP 3000/500        OpenVMS 6.1           3.0.2
  196.     DecAlpha VAX station 3100    OpenVMS 6.1           3.0.2
  197.     HP                           HP/UX 9.0.1/10.0      3.0.2
  198.     HP Softbench                 HP/UX 9.03            3.0.2
  199.     IBM RS/6000                  AIX 3.2.5             3.0.2
  200.     IBM RS/6000                  AIX 4.1.4             3.0.2
  201.     SGI                          Irix 5.3              3.0.2
  202.     Sun                          SunOS 4.1.3           3.0.2
  203.     Sun                          Solaris 2.3           3.0.2
  204.     Sun                          Solaris 2.4/2.5       3.0.2
  205.     DG AviiON                    GX/UX 5.4             3.0.2
  206.     Intel x86                    SVr3 SCO ODT 5.0      3.0.2
  207.     Intel x86                    SVr4 NCR 2.02         3.0.2
  208.     Intel x86                    NT 3.51/Win 95        TU/Win 3.0
  209.    
  210.  
  211. Q: To what other platforms is Thomson planning to port TeleUSE?
  212. A: [From Paul, paul@thomsoft.com]
  213.  
  214.     HP  HP/UX 10.10/10.20      3.0.2
  215.  
  216. Q: Does TeleUSE generate C and/or C++ ?
  217. A: [From Rhoda, rhoda@thomsoft.com]
  218.     Yes, TeleUSE genertes code in C and C++.
  219.     You can tell the TeleUSE code generator to generate code in either
  220.     KRC, ansi style C, or C++.  If you are interested in C++ code,
  221.     you can tell the code generator to create C++ classes for 
  222.     any specified widget hierarchies (templates) that you have
  223.     developed.  You can also specify that widget descendants in the
  224.     hierarchy  should be available in the private/protected/public
  225.     section of the C++ class generated.  In addition, you can specify
  226.     what resources for any widget in the hierarchy will be available
  227.     via get/set member functions in the C++ generated class.
  228.  
  229. Q Does TeleUSE generate Ada?
  230. A: [From Rhoda, rhoda@thomsoft.com]
  231.    Ada code can also be generated using the TeleUSE/Ada
  232.    product.   This product will generate Ada code for the
  233.    presentation layer (pcd files), the dialog layer
  234.    (D modules) and all other intermediate source files 
  235.    (e.g. main program).  The TeleUSE/Ada product as well
  236.    as the TeleUSE product allows you to call ada subprograms
  237.    from D.
  238.  
  239.    TeleUSE/Ada is available for the following platforms/compilers:
  240.        Solaris 2.3 (AdaWorld/Verdix/RISCAda)
  241.        SunOS 4.1.3 (AdaWorld)
  242.        HPUX 9.03 (AdaWorld)
  243.        SCO ODT 3.0 (AdaWorld/Verdix)
  244.  
  245.  
  246. Q: Do I need the TeleUSE library to execute an application?
  247. A: [From Rhoda, rhoda@thomsoft.com]
  248.    If system A and System B the same platform/same OS,
  249.    then if you link the application statically, you can move
  250.    the executable to the other machine that does NOT have
  251.    TeleUSE libraries and execute it there.
  252.  
  253.    By default, the TeleUSE libraries will be required to re-build
  254.    the application.  So if you need to move to another platform,
  255.    you need to have the TeleUSE libraries available on that target.  
  256.    You can purchase them from Thomson Software Products if the target
  257.    is a platform that we already support or you can build them yourself 
  258.    since the source code to the runtime libraries is included free with 
  259.    TeleUSE.
  260.  
  261.    Alternatively, you have tell the TeleUSE code generator to generate
  262.    code that is NOT dependent on any runtime libraries, but in order
  263.    to use this 'pure-c' mode you will not be able to take advantage 
  264.    of some of the TeleUSE features, such as D, C++, UserDefinedAttributes,
  265.    in your application.
  266.  
  267. Q: Is there a D-mode for emacs/lemacs/xemacs ?
  268. A: [From B.G. Mahesh, mahesh@mahesh.com]
  269.    You should be able to find one in the $TeleUSE/TeleUSE/lib/emacs 
  270.    [where $TeleUSE is the directory in which you have installed TeleUSE]
  271.  
  272.    [From TJ Phan, phan@aur.alcatel.com]
  273.    I've set up emacs/xemacs syntax highlighting for d-mode. This might be 
  274.    of use to other people. You can download this file from 
  275.    http://www.mahesh.com/TeleUSE/hl319.el
  276.  
  277. Q: What versions of Motif do I need to use with TeleUSE?
  278. A: [From B.G. Mahesh, mahesh@mahesh.com]
  279.    TeleUSE 3.0.x requires Motif 1.2
  280.    TeleUSE 2.1.x requires Motif 1.1.
  281.  
  282.    The appropriate version of Motif and X is provided with TeleUSE 
  283.    on most platforms as a convenience to the customer.
  284.  
  285.  
  286. Q: When I call "create widget" in D using the optional parameters for
  287.    another display and screen, the widgets appear on my default 
  288.    display/screen. How can I get "create widget" to create widgets on 
  289.    another display?
  290. A: [From John Goodsen, jgoodsen@radsoft.com]
  291.    There is missing information in the 3.01 documentation set (page 4-19
  292.    of the "Developing Dialog Components" manual)
  293.  
  294.    Before attempting to create any widgets on the display, you must open the
  295.    display using "ux_define_display(...)".
  296.  
  297.    For example, we would first in C define the display "spot:0" with the
  298.    logical name "spot" for the application "test":
  299.  
  300.           ux_define_display("test", "Test", "spot", "spot:0",
  301.                             NULL, 0, &argc, argv, &status);
  302.  
  303.    Then we could in D create a window on this display:
  304.  
  305.           remote := create widget("spotview", nil, nil, "spot", 0);
  306.  
  307.    This statement creates a widget named "spotview" on the default
  308.    logical screen (0) of the remote display "spot".
  309.  
  310.  
  311. Q: In an attribute window, what is the meaning of a gray setting
  312.    marker ?
  313. A: [From Thomson Software Products]
  314.    A gray setting marker indicates that the value shown is inherited.
  315.  
  316. Q: Does VIP allow you to add comments to a particular template ?
  317.    If so, how?
  318. A: [From Thomson Software Products]
  319.    If the widget is selected in the work area, you can enter text
  320.    as comments in the right hand side of the status area (above
  321.    the work area). These comments are saved in the pcd file as a 
  322.    'comments' attribute.
  323.  
  324. Q: What is the purpose of a user-defined attribute ?
  325. A: [From Thomson Software Products]
  326.    A User-Defined Attribute allows a widget to carry data with it.
  327.    They are useful to use instead of having to maintain so many local
  328.    variables in a D module.
  329.  
  330. Q: How do you use the Drag-On box? What is the purpose of the Drag-On
  331.    box in the value windows (colors, pixmaps, fonts) ?
  332. A; [From Thomson Software Products]
  333.    You can drag icon templates OR nodes from a tree OR widgets in the
  334.    work area into a Drag-On box. In the Value Window, the drag-On box
  335.    can be used to add to the list of values on the left hand side of
  336.    the Value Window. For example, if a template is using colors that are
  337.    defined into VIP, you can drag the template into the Drag-On box for
  338.    the Color Value Window and the new colors will be added to the list
  339.    of colors on the left side of the Value Window.
  340.  
  341. Q: What is a D event field? How can it be accessed in D ?
  342. A: [From Thomson Software Products]
  343.    Data carried with a D event. It is accessed in D using the form:
  344.    
  345.           <D event name>.<D event field>
  346.  
  347. Q: What is the difference between a Devent and a rule?
  348. A: [From Larry Young, lyoung@dalmatian.com]
  349.    A Devent is a "signal" (not in the UNIX sense!) that something has
  350.    occurred, which contains certain contextual data.  It can also be
  351.    thought of as a notification object (instance) that has certain data
  352.    associated with it, and that when it is "sent" it will notify all
  353.    "rules" that have registered with it.
  354.  
  355.    A Rule is simply a body of code that will be run when its condition
  356.    (i.e. the part before the keyword "does") is true.  Normally, the
  357.    condition contains the name of a Devent, so that when that Devent is
  358.    sent, it will notify the rule and the rule will execute it's body of
  359.    code.  Note that if multiple rules are registered to the same Devent,
  360.    their order of execution is undefined.
  361.  
  362. Q: Why is it that the Devents attached to my "createCallback" attributes
  363.    aren't always sent?
  364. A: [From Larry Young, lyoung@dalmatian.com]
  365.    The problem isn't that the Devent isn't sent, it's that your rule
  366.    hasn't been registered for that Devent yet.  In TeleUSE, each Dmodule
  367.    is initialized separately, and it is during this "init" process that
  368.    each rule is registered with its specific Devent, local data is
  369.    created, and the dmodule's INITIALLY rule is run.  Thus, if the first
  370.    Dmodule initialized is the one that creates the widgets,  then the
  371.    other Dmodules won't have had a chance to register their rules yet,
  372.    therefore the createCallbacks appear to get lost.
  373.  
  374.    The simple solution is to not create widgets in your INITIALLY rule
  375.    (creating and initializing local variables is ok!).  Instead, do
  376.    the following in one of your Dmodules (I usually create a separate
  377.    Dmodule called "Main" for this and other generic Devent handlers):
  378.  
  379.    devents:
  380.     MainInit :local [];
  381.  
  382.    locals:
  383.     top_w : widget;
  384.  
  385.    rules:
  386.     INITIALLY does
  387.       send (MainInit);  -- allow all INITIALLY's to run first !!
  388.     end does;
  389.  
  390.     MainInit does
  391.       top_w := create widget ("MyApplShell", nil, nil);
  392.       top_w.show;
  393.  
  394.       --
  395.       -- ... whatever else needs to be done ...
  396.       --
  397.  
  398.     end does;
  399.  
  400.    end dmodule;
  401.  
  402. Q: Where can you look up the widget class specific pre-defined event
  403.    fields ?
  404. A: [From Thomson Software Products]
  405.    Each of the members of the callback structure is available as a D
  406.    event field. These callback structures can be found in the Motif 
  407.    Programmer's Reference for any given widget class, under 'Callback
  408.    Information' or you can use 'man' on the widget class or 
  409.    'tuqref <widget class>''
  410.  
  411. Q: What is the scope of a D event field for a given D event?
  412. A: [From Thomson Software Products]
  413.    The scope of a D event field is limited to the associated rule.
  414.    It is possible to assign to another D event's D event field before
  415.    sending the D event but it is erroneous to read another D event's 
  416.    event field.
  417.  
  418.  
  419. Q: If there is no callback available for a particular event of interest,
  420.    how can we attach a D event to it?
  421. A: [From Thomson Software Products]
  422.    A translation can be used. Also an event handler can be used which
  423.    ties a C function to an X event. The event handler (C function)
  424.    could 'send' a D event.
  425.  
  426.  
  427. Q: What are the valid UDA types that I can define?
  428. A: [From Larry Young, lyoung@dalmatian.com]
  429.    The list provided in the Vip "Define User Attributes" window is
  430.    only a subset of the possible choices ... not exactly intuitive!
  431.    Basically, you can use any valid X resource type that has been
  432.    registered with the XtConvert mechanism (at the time 'vip' was
  433.    built!).  So you can use types like:
  434.     Alignment (XmRAlignment)
  435.     SiblingWidget (TuRSiblingWidget)
  436.     WidgetChild (TuRWidgetChild)
  437.     Cursor (XtRCursor)
  438.     XRectangleList (TuRXRectangleList)
  439.     IntTable (TuRIntTable)
  440.     StringTable (XtRStringTable)
  441.     Pointer (XtRPointer)
  442.     ... etc ...
  443.  
  444.    When you define UDAs in D code (e.g. "w.define("Name", "XType");"),
  445.    you may use any valid D datatype, including any "User Datatypes"
  446.    defined in your AIM files, as well as all the X resource types.
  447.  
  448.    Note that X types don't currently work from D in TU3.0.2beta :(
  449.    Also, don't use the "Callback" type listed in the UDA Type popup
  450.    menu in Vip, it doesn't have a converter registered for it!
  451.  
  452.  
  453. Q: Is there a way in d-code to check for the existence of 
  454.     a user-defined attribute before accessing it ?
  455. A: [From Larry Young, lyoung@dalmatian.com]
  456.  
  457.    If you are using TeleUSE 3.0.2 (the final release, not the beta),
  458.    you can use the predefined operation "is_defined()" on the widget 
  459.    datatype.  Actually, it returns the type of the attribute, but if 
  460.    it hasn't been defined it returns "nil".  And this works for normal 
  461.    widget attributes as well as UDAs.
  462.  
  463.    So basically you can test for existence like this:
  464.  
  465.       if (my_w.is_defined("MyUDA") != nil) then
  466.         -- the UDA exists
  467.       end if;
  468.  
  469.    If you are using an older version of TeleUSE, you'll have to call
  470.    "tk_user_attr_type(widget, uda_name)" which basically does the same 
  471.    thing as "is_defined" does but only works for UDAs.  In fact, 
  472.    "is_defined" uses this "tk" function internally.  Also, if you want 
  473.    to use the "tk" function from D, you'll have to put its function 
  474.    definition into an AIM file.  You can find the function definition 
  475.    in $TeleUSE/include/teleuse/tk_widops.h.
  476.  
  477. Q: How to access and set UDAs in C?
  478. A: [From Paul Thornton, paul@thomsoft.com]
  479.  
  480.   In $TeleUSE/include/teleuse/tk_widops.h you will find 2
  481.   undocumented routines.  These routines allow you to set/get
  482.   UDAs from c code:
  483.  
  484.   extern void tk_get_widget_attr();
  485.     /* Widget widget; */
  486.     /* tu_string attr; */
  487.     /* tu_string * prtype; */
  488.     /* tu_pointer * pvalue; */
  489.     /* tu_status_t * status; */
  490.  
  491.   extern void tk_set_widget_attr();
  492.     /* Widget widget; */
  493.     /* tu_string attr; */
  494.     /* tu_string rtype; */
  495.     /* tu_pointer value; */
  496.     /* tu_status_t * status; */
  497.  
  498.   Example:
  499.  
  500.     tu_string uda_type;
  501.     tu_pointer uda_value;
  502.     tu_status_t status;
  503.  
  504.     tk_get_widget_attr(wid, "My_UDA", &uda_type, &uda_value, &status); 
  505.  
  506.     -- If My_UDA is a string, 
  507.  
  508.     char *result_str;
  509.     result_str = (char *)uda_value; 
  510.  
  511.     To Set UDAs:
  512.  
  513.      tk_set_widget_attr (wid, "Other_UDA", XtRString, uda_value, &status);
  514.                                            ^^^^^^^^^
  515.                   Found in $TeleUSE/X11R5/include/StringDefs.h
  516.  
  517. Q: How do I send a D event from C ?
  518.    [From Tony Giaccone, tgia@radix.net]
  519.  
  520.    Caution: The following example does NO ERROR CHECKING.
  521.  
  522.     This is not a wise practice and will with out doubt
  523.     get you into trouble. However, it is meant as an
  524.     example and as an example it has no real context. 
  525.     With out a context to work in Error processing is 
  526.     pretty difficult to manage. You on the other hand
  527.     have a context. So do the error checking.
  528.  
  529.     There are two steps to sending a devent from C.
  530.  
  531.     1. Creating the devent instance.
  532.  
  533.     2. Dispatching the event.
  534.  
  535.     Here's a general purpose c function which handles dispatching 
  536.     any devent. 
  537.  
  538.         void  send_d_event(
  539.                char        *devent_name,
  540.         /* char        *dfield_name,  0 or more repititions of these */
  541.         /* char        *dtype_name,   3 fields */
  542.         /* XtPointer    data_addr,             */
  543.         /* NULL)                   NULL must be present, terminates list */
  544.        {
  545.             tu_status_t          status;
  546.             ux_devent_instance   devent_inst;
  547.             va_list              argsPtr;
  548.             char                 *dfield_name;
  549.             char                 *dtype_name;
  550.             XtPointer            data_addr;
  551.  
  552.  
  553.              devent = ux_get_devent(devent_name, NULL,0, &status);
  554.  
  555.              if (status.all != tu_status_ok) {
  556.  
  557.                 /* Handle the error condition */
  558.  
  559.              }
  560.  
  561.  
  562.              /* 
  563.              ** first parse the arguments which might have been passed into 
  564.              ** our devent. This routine handles the general case if you wanted
  565.              ** to handle only one D Event, you could simplify this code.
  566.              **
  567.              */
  568.  
  569.              va_start(arg_ptr, devent_name);
  570.  
  571.              while ((dfield_name = va_arg(arg_ptr, char *)) != NULL) {
  572.  
  573.                  dtype_name  = va_arg(arg_ptr, char *);
  574.         
  575.                  data_addr   = va_arg(arg_ptr, XtPointer);
  576.         
  577.                  ux_assign_devent_field(
  578.                                 devent,
  579.                 dfield_name,dtype_name,(tu_pointer)data_addr,
  580.                                 &status);
  581.  
  582.             if (status.all != tu_status_ok) {
  583.  
  584.                /* Handle the error condition */
  585.  
  586.             } /* if (status.all != tu_status_ok) */
  587.  
  588.               } /* while */
  589.  
  590.  
  591.               va_end(arg_ptr);
  592.  
  593.  
  594.               /* CALL ONLY ONE OF THE FOLLOWING ROUTINES */
  595.  
  596.               /*
  597.               ** This routine actually calls the devent. With the
  598.               ** appropriate fields set. The event is placed into the 
  599.               ** devent queue and will be handled when it reaches the
  600.               ** top of the queue.
  601.               */
  602.  
  603.               tu_queue_event(devent,&status);
  604.  
  605.               /* 
  606.               ** If you called tu_queue_event don't forget to check the
  607.               ** status of the call.
  608.               */
  609.  
  610.  
  611.               /*
  612.               ** Or call this routine.....
  613.               */
  614.  
  615.               /*
  616.               ** this routine calls the devent immediately. There is no delay
  617.               ** it's like makeing a send(devent,0) call in D.
  618.               */
  619.  
  620.               tu_dispatch_event(devent);
  621.  
  622.         } /* send_d_event */
  623.  
  624.     So, given a D event called MyDEvent which has the
  625.     following definition
  626.  
  627.     MyDEvent [  AnInt   : integer;
  628.             AString : string;
  629.             AStruct : Out_C_Struct;
  630.         ];
  631.  
  632.            where Our_C_Struct is a c structure defined in an aim file.
  633.  
  634.  
  635.     In the calling code you would make the following call:
  636.  
  637.     send_d_event("MyDEvent",
  638.              "AnInt",   XtRInt,      c_int_variable,
  639.              "AString", XtRString,   c_char_ptr,
  640.              "AStruct", XtRPointer,  a_c_structure,
  641.               NULL);
  642.  
  643.  
  644. Q: Can any C routine be called from D ? What are the limitations?
  645. A: [From Thomson Software Products]
  646.    If an only if the parameters and the return value can be accurately
  647.    represented in D.
  648.  
  649.  
  650. Q: What is the purpose of the 'opaque' type?
  651. A: [From Thomson Software Products]
  652.    The opaque thpe is PRIMARILY intended for holding pointers returned by
  653.    C function calls. But it can hold anything that is 32 bits. If it holds
  654.    an address, there is no way, in D, to reference the object that is
  655.    pointing to.
  656.  
  657. Q: Are type conversions in D the same as type casting in C ?
  658. A: [From Thomson Software Products]
  659.    Type conversion in D actually changes the underlying bit representation
  660.    of the object where casting does not.
  661.  
  662. Q: Is it possible to declare a D event that is global across more than one
  663.    D modules ? 
  664. A: [From Thomson Software Products]
  665.    Yes. Specify it in a D events file (.de file). The D devent can also
  666.    be declared in both D modules but both declarations must be identical
  667.    and they must not be declared as 'local'. The latter method is not 
  668.    recommended.
  669.  
  670. Q: Is it possible to declare a D variable that is global across more than
  671.    one D module?
  672. A: [From David Quin-Conroy]
  673.    A local variable in a D module instance can be declared "exported" which 
  674.    makes it accessible from other D module instances. This is described in 
  675.    "Developing Dialog Components" page 4-58. The same is true for D events.
  676.    By using the "exported" feature, there is probably no need to use .de 
  677.    files.  The ability to 'export' local variables was introduced with 
  678.    TeleUSE 3.0. Although D variables are still not directly share-able, you 
  679.    CAN access another D modules local variables IF 
  680.               1) they are exported and IF
  681.               2) you have a handle to the D module instance. 
  682.  
  683.  
  684. Q: What 3 things must be true in order for a widget to be visible ?
  685. A: [From Thomson Software Products]
  686.    It must be realized, managed, and mapped. If a widget has no parent,
  687.    though, managing it is meaningless. A widget needs to be explicitly 
  688.    realized ONLY if none of its ancestors have been realized or it has
  689.    no ancestors. Non-shell widget are managed automatically when they 
  690.    are created so no explicit managing is necessary.  TopLevelShell and 
  691.    ApplicationShells should be opened/closed, after they have been 
  692.    realized, using:
  693.  
  694.       top_shell.do_popup();  <-- opens shell 
  695.       top_shell.do_popdown;  <-- closes shell
  696.  
  697. Q: What does AIM stand for?
  698. A: [From Thomson Software Products]
  699.    Application Interface Mapping. Used for defining the C function that
  700.    are to be called from D.
  701.  
  702. Q: How can the UI builder generate AIM file?
  703. A: [From Thomson Software Products]
  704.    Using the AIMEXTR entry in the configuration file. You must have access
  705.    to the C source code in order to uxb to be able to generate the aim file.
  706.  
  707. Q: What does uxb guess do?
  708. A: [From Thomson Software Products]
  709.    Creates a file called uxb.conf based on the files it finds in the
  710.    local directory.
  711.  
  712. Q: If I have a string in the uxb.conf file that matches my platform
  713.    name such as 'sun', uxb does not accept it.  How can I get around
  714.    this?
  715. A: [From Rhoda, rhoda@thomsoft.com]
  716.    You can put the following in uxb.conf to undefine the word 'sun'
  717.    in case user need that word in the config file.  Example:
  718.    if a directory has  xxx/xxx/sun/xxx/xxx .
  719.  
  720. #ifdef sun
  721. #undef sun
  722. #define sun sun
  723. #endif
  724.  
  725. Q: What is the difference between 'c' and 'pure-c' mode ?
  726. A: [From Thomson Software Products]
  727.    In 'pure-c' mode, no TeleUSE runtime calls are made from the
  728.    generated c file. In this mode, no D can be used.
  729.  
  730. Q: What is the difference between LANGUAGE C and LANGUAGE KRC ?
  731. A: [From Thomson Software Products]
  732.    With C, the INCLUDE section is used, with KRC the INCLUDE section
  733.    is ignored. With C, all enteries must be prototyped in a header
  734.    file that is included and all structure definition must be in
  735.    header file. If you are using any new features, such as structures
  736.    or globals you need to use LANGUAGE C.
  737.  
  738.  
  739. Q: How can I allow for the ehdb file to be in another directory
  740.    besides the current working directory?
  741. A: [From Rhoda, rhoda@thomsoft.com]
  742.    In order to allow for the ehdb file to be in another directory 
  743.    you can use the DESTDIR option in the configuration file.
  744.    Then run:
  745.  
  746.     >  uxb  -- to build
  747.     >  uxb install -- to move the file to the DESTDIR
  748.  
  749.    The DESTDIR configuration option changes the automatically generated
  750.    uxb_mainc.c so that the ehdb file is looked for in the destination
  751.    directory.  The user can rely on an environment variable to find
  752.    the file in the directory, or the path can be fixed.
  753.  
  754. Q: If I have a string in D that represents the name of a D event,
  755.    how can I send the D event?
  756. A: [From Rhoda, rhoda@thomsoft.com]
  757.    Here is an example:
  758.  
  759.        ***********
  760.        devents:
  761.           foo :local[];
  762.    
  763.        locals:
  764.           x: string;
  765.            d: devent;
  766.  
  767.        rules:
  768.           SomeCallback does
  769.              x := "foo";
  770.              d := self.(x);
  771.              send(d);
  772.           end does;        
  773.  
  774.           foo does
  775.              printf("In foo\n");
  776.           end does;
  777.        ************
  778.  
  779.   If you have a UDA of type string that represents the name of 
  780.   a D event field, you can use:
  781.  
  782.          *************
  783.           x := SomeCallback.source_widget.StringUDA;
  784.           d := self.(x);
  785.           send(d);
  786.           --          or simply:
  787.           d := self.(SomeCallback.source_widget.StringUDA);
  788.           send(d);
  789.      ************* 
  790.    
  791.  
  792. Q: Can I use the string_list operators directly on a C global
  793.    variable of type 'char **'?
  794. A: [From Rhoda, rhoda@thomsoft.com]
  795.    No. Globals can only be modified by direct assignment. Dot operators
  796.    will not work on globals directly.   If you want to use the string_list 
  797.    operations, you must use a temporary local variable and then assign
  798.    it to the global.
  799.  
  800.    Example:
  801.  
  802.    If 'global_String_list' is declared in an aim file as:
  803.  
  804. TYPE
  805.    "char **" <--> string_list;
  806. ENTRY
  807.     global_string_list  :  "char **";
  808.  
  809. In D use:
  810. -- build the string_list:
  811. local_string_list := create string_list();
  812. local_string_list.insert("item1",0); 
  813. local_string_list.insert("item2",0); 
  814. local_string_list.insert("item3",0); 
  815. local_string_list.insert("item4",0); 
  816.  
  817. -- assign to the global:
  818. global_string_list := local_string_list;  
  819.  
  820.     
  821.  
  822. Q: How can I set resources on the eht help windows?
  823. A: [From Rhoda, rhoda@thomsoft.com]
  824.    You can set resources for the Help Windows in a resource file.
  825. The name of the eht help window TopLevelShell widget is 'eht'.
  826.  
  827. To set the iconPixmap of the help windows in a resource file use:
  828.  
  829.              *eht*iconPixmap:  <bitmap file name>
  830.  
  831. To set the fontList for the buttons in the help window use:
  832.  
  833.        *eht*fontlist:  <font specification>
  834.  
  835. To set the fontlist for a help window frame use:
  836.  
  837.        *eht*help_text.fontlist:  <font specification>
  838.  
  839. Q: When I try to turn off the file list in the XmFileSelectionBox
  840.    by setting 'showList' to false, I get an empty square window in the
  841.    upper left corner of the FileSelectionBox.  How can I remove it?
  842. A: [From Rhoda, rhoda@thomsoft.com]
  843.    The problem is occurring because XmScrolledWindow parent of the
  844.    file list needs to be unmapped.
  845.  
  846.    To remove the problem, use:
  847.  
  848.   dmodule main 
  849.    #include <teleuse/teleuse.h>
  850.    ... 
  851.    INIITIALLY does
  852.        top := create widget ...
  853.        list_wid : widget := XmFileSelectionBoxGetChild(top->FSB, XmDIALOG_LIST);
  854.        list_wid.parent.mapped := false;
  855.                 ^^^^^^
  856.                 set the XmScrolledWindow not just the XmList.
  857.  
  858.    also use:
  859.  
  860.    uxb.conf
  861.    -------
  862.    DINCLUDEDIR  $TeleUSE/include
  863.  
  864.    to define teleuse/teleuse.h in d.
  865.  
  866. Q: When I set the background color on a ScrolledWindow, I still
  867.    can see the default color in some areas of the ScrolledWindow.
  868.    Especially when the contents of the ScrolledWindow do not fill the
  869.    ScrolledWindow.  How can I set the whole ScrolledWindow's background?
  870. A: [From Rhoda, rhoda@thomsoft.com]
  871.    You can set the background of the WHOLE scrolledWindow in D using:
  872.  
  873.    top->ScrolledWindowClipWindow.background := top->scrolledWindow.background;
  874.    top->VertScrollBar.background := top->scrolledWindow.background;
  875.    top->HorScrollBar.background := top->scrolledWindow.background;
  876.  
  877.    The internal widget names for a scrolledWindow are:
  878.  
  879.      ScrolledWindowClipWindow
  880.      VertScrollBar 
  881.      HorScrollBar
  882.  
  883. Q How can I specify the geometry of an application from the command-line?
  884.    When I use the -geometry option with a TeleUSE generated application
  885.    (e.g., <app> -geometry 600x800+50+50), the option is ignored.
  886.  
  887. A: [From Larry Young (lyoung@dalmatian.com) and Rhoda Quate (rhoda@thomsoft.com)]
  888.  
  889.    The "-geometry" command-line option is defined by Xt as ".geometry", not
  890.    "*geometry". When TeleUSE builds an application, it places an "invisible"
  891.    shell above all your shells to provide a consistent way of naming resources;
  892.    therefore, your "-geometry" specification is being applied to this invisible
  893.    shell instead of to the one you had intended.
  894.  
  895.    Instead, use the -xrm option (e.g., <app> -xrm "*geometry: 600x800+50+50").
  896.    The downside of this approach is that it will affect ALL TopLevelShells
  897.    that are in your application for which the size/position is not
  898.    hard-coded! You can limit this problem if you know the name of the
  899.    shell at the top of the widget tree (assuming you know its name). In
  900.    that case, replace the "*" with "*widget_name."
  901.    (e.g., <app> -xrm "*AppShell.geometry: 600x800+50+50").
  902.  
  903.  
  904. Q: Which 3rd party widgets have been integrated with TeleUSE?
  905. A: [From Rhoda Quate, rhoda@thomsoft.com]
  906.  
  907.   
  908.   Name        : XRT widgets 
  909.   Vendor      : KL Group 
  910.   Description : Integrations are maintained by Thomson Software for:
  911.                 XRT/3d
  912.                   The easiest way to build informative and dynamic
  913.                   3-D charts and graphs into Motif applications.
  914.                 XRT/field 
  915.                   The easiest way to build professional data-entry
  916.                   fields into Motif applications.
  917.                 XRT/gear (integration promised soon)
  918.                   The essential collection of add-on widgets and
  919.                   utilities for Motif.
  920.                 XRT/graph
  921.                   The easiest way to build powerful 2-D charts and
  922.                   graphs into Motif applications.
  923.                 XRT/table
  924.                   The essential multi-purpose widget for displaying
  925.                   and editing lists, tables and forms.
  926.   Email       : info@klg.om
  927.   Home Page   : http://www.klg.com
  928.   Download Integration: ftp.klg.com:/pub/integrations/TeleUSE.tar.z
  929.  
  930.  
  931.  
  932.   Name             : Xbae                        
  933.   Vendor           : Public Domain 
  934.   Description      : XbaeMatrix is a Motif widget which presents an editable 
  935.                      array of string data to the user in a scrollable table 
  936.                      similar to a spreadsheet.
  937.                      XbaeCaption is a simple Motif manager widget used to 
  938.                      associate an XmLabel (caption) with it's single child. 
  939.   Source           : ftp.x.org:contrib/widgets/motif/Xbae-4.5.tar.gz
  940.   Download Integration: http://www.mahesh.com/TeleUSE/xbae_teleuse.tar.gz
  941.  
  942.  
  943.   Name        : Tuw Widgets 
  944.   Description : TuwItemBox
  945.                     Container that manages special kinds of objects called 
  946.                     Tuw items. A Tuw item can consist of an icon and an  
  947.                     optional name.
  948.                 TuwItemMenu
  949.                     Designed to handle the common situation requiring a
  950.                     dynamic menu, one in which the number of items varies 
  951.                     as the application executes. 
  952.                 TuwSource
  953.                     Displays a text file with line numbers in front of 
  954.                     each line. TuwSource widget was 
  955.                     developed to support source display in a debugger. 
  956.                 TuwTree
  957.                     Displays a tree structure of nodes.  
  958.                 TuwTable
  959.                     Allows you to build tables with different kinds of 
  960.                     objects. 
  961.   Source      : Included with TeleUSE in $TeleUSE/conf/examples/tuw
  962.  
  963.  
  964.   Name        : DT Widgets                  
  965.   Description : SpinButton 
  966.                    A widget that allows you to cycle through a list
  967.                    of values in the forward or reverse direction.
  968.                 ComboBox      
  969.                    A widget that contains a text and an arrow which 
  970.                    posts a list of options for selection upon button press.
  971.   Source      : Included with TeleUSE $TeleUSE/conf/examples/cde
  972.  
  973.  
  974.   Name        : EnhancementPak Widgets  
  975.   Vendor      : ICS
  976.   Description : A collection of general purpose widgets, consisting
  977.                 of controls, geometry managers, and resource editors. 
  978.   Email       : info@ics.com
  979.   Home Page   : http://www.ics.com/Products/Epak/epak.html 
  980.                                
  981.  
  982. Q: Can I use the xm_string_list operations directly on the
  983.    resources of the XmList ?
  984. A: [From B.G. Mahesh, mahesh@mahesh.com and 
  985.     Rhoda, rhoda@thomsoft.com]
  986.  
  987.    Is the following code valid ?
  988.  
  989.         top->nameScrolledList.selectedItems.rewind;
  990.         if (top->nameScrolledList.selectedItems.more) then
  991.             sv := top->nameScrolledList.selectedItems.next;
  992.         end if;
  993.  
  994.    Syntatically it is correct but you should not do such operations
  995.    (like rewind) directly on the scrolled list.
  996.    Load top->nameScrolledList.selectedItems to a local
  997.    variable before operating on it.  This is because this expression
  998.    invokes a function call and stores the result in a temporary
  999.    variable.  Operating on the temporary variable is useless.
  1000.  
  1001.  
  1002. ------------------------------------------------------------------
  1003. B.G. Mahesh               | Home Page: http://www.mahesh.com
  1004. Internet Consultant       | FAQ Maintainer of TeleUSE GUI Builder
  1005. Email: mahesh@mahesh.com  | 
  1006.