home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / tcl / 1076 < prev    next >
Encoding:
Text File  |  1992-07-30  |  4.1 KB  |  102 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!eco.twg.com!twg.com!news
  3. From: "David Herron" <david@twg.com>
  4. Subject: Re: tk widgets from Motif libs?
  5. Message-ID: <1992Jul30.184848.9322@twg.com>
  6. Sensitivity: Personal
  7. Encoding:  82 TEXT , 4 TEXT 
  8. Sender: news@twg.com (USENET News System)
  9. Conversion: Prohibited
  10. Organization: The Wollongong Group, Inc., Palo Alto, CA
  11. Conversion-With-Loss: Prohibited
  12. Date: Thu, 30 Jul 1992 18:50:36 GMT
  13. Lines: 87
  14.  
  15. > Have tk widgets ever been built from the Motif libraries?  If not,
  16. > what would be involved in doing this?
  17.  
  18. Do you mean to ask:  "Has a tk-like programming interface to Motif widgets
  19. been built?"
  20.  
  21. If so.. I'm not sure this is possible.  The concepts do not seem to map
  22. very well.  Geometry management with Motif is wildly different than
  23. with TK, for instance.
  24.  
  25. What I have been looking at (infrequently) is to bring the Xlib/Xt/Motif
  26. programming calls out to TCL.  This serves my purposes more closely as
  27. it will help with prototyping/building Motif applications.  I am starting
  28. with a package someone (forget who) wrote for Perl to do the same thing.
  29.  
  30. The package includes a set of template files describing all the procedure
  31. calls in Xlib on-up.  A template looks something like a procedure definition
  32. along with a list of parameters and types.  There is room for giving default
  33. values for local variables, and specifying extra code to call.  There is a perl 
  34. script which converts these templates into a `command procedure' which parses
  35. the argument list to get the input values, calls the procedure, and encodes
  36. the output values into perl variables.
  37.  
  38. So far I have played with the perl script to make it generate code suitable
  39. for use within TCL.  Not all of this is finished.  Also come of the code
  40. snippets in the template files work within perl, and will have to be rewritten
  41. for TCL.
  42.  
  43. Things left to do:
  44.  
  45. - Have a way to specify Xt style argument lists.  Something like
  46.  
  47.     { {XmNwidth 50} {XmNheight 60} ... }
  48.  
  49.   would be hunky-dory.
  50.  
  51.   So there'll need to be a procedure somewhere to map resource names into
  52.   their proper value.  Also a number of procedures to convert the string
  53.   form of the resource value into the internal value.  Fortunately for
  54.   the latter, Xt already has converter routines for this purpose.  Hopefully
  55.   they aren't too strictly focused on parsing resource files ;-).
  56.  
  57. - The template file approach does *nothing* for manipulating the contents
  58.   of a data structure.  I don't know what this guy did in Perl, but it was
  59.   probably ugly things with PACK and UNPACK ;-).  Also, to return a pointer
  60.   to a data structure (say, a Widget), it converts the pointer value into
  61.   a decimal string and passes that back to the calling script!  To make a
  62.   call using that widget you pass the decimal string back to the interpreter.
  63.  
  64.   Well, shoot..  Surely we can generate a `handle', then for some/all the data
  65.   types specify some procedures which take that handle.
  66.  
  67. - Should it provide access to the Xt event mechanism?  Should callback routines
  68.   go directly to a TCL script?  If so, what about the EVENT structure passed
  69.   to the callback routine?
  70.  
  71. - There must be more ..
  72.  
  73.  
  74.  
  75.  
  76. A couple of related things:
  77.  
  78. - wafe tread upon similar ground.  I looked at it and came away under impressed,
  79.   but don't remember why.  The part where it would run a perl script as a
  80.   a seperate process and send commands to wafe through a pipe is a definite
  81.   weirdity and shouldn't be necessary.
  82.  
  83.   Don't remember where to get it ;-(
  84.  
  85. - There is a commercial product called ezX available from Sunrise Software.
  86.   On the glossy sheet is a paragraph:
  87.  
  88.     Any interpreted language can be used to control the behavior
  89.     of windows and widgets.  Common languages such as Tcl, BASIC or PROLOG
  90.     can be used or a custom language defined and integrated by
  91.     the end user.
  92.  
  93.   And when I was talking with the guy at Xhibition he implied that they had
  94.   some sort of interface from Tcl to Motif, but did not get a good impression
  95.   of what he meant.  Anybody know?
  96.  
  97.  
  98. <- David Herron <david@twg.com>, Just: Another E-Mail hacker ...
  99. <-
  100. <- As for the prevalence of gratuitous stupidity in modern life, well,
  101. <- need I say more than "MS-DOS"? -- Bill Janssen
  102.