home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1898 < prev    next >
Encoding:
Text File  |  1992-11-19  |  3.2 KB  |  72 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 and Macintosh?
  5. Message-ID: <1992Nov19.235354.25088@twg.com>
  6. Sensitivity: Personal
  7. Encoding:  52 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, 19 Nov 1992 23:57:22 GMT
  13. Lines: 57
  14.  
  15. I spent some time last summer looking at Tk and trying to get a feeling
  16. for how easily it would port to other windowing systems ...
  17.  
  18. Tk, as it is currently implemented, uses X calls all through the library.
  19. There are utility procedures in the library which, for instance, handle
  20. text drawing and the 3D borders and so on.  Then the widgets don't have
  21. much (or any, in some cases) X specific code to draw text or 3D borders.
  22. And some of the widgets look to be very portable ...  But some are not.
  23.  
  24. Out at the script level Tk doesn't hardcode X concepts into its concepts.
  25. Most of the commands are pretty generic but there are a few exceptions.
  26. For instance, when you specify a font name it is in the X format
  27. for font names.  Then the way one creates a modal dialog is by using
  28. the `grab' command to make sure only the modal dialog window gets events;
  29. the `grab' concept is something I've only seen in X.  These are the
  30. two which come immediately to mind ..
  31.  
  32. There are three ways to proceed:
  33.  
  34. - Portable graphics and event handling library.  You'd knock some of the
  35.   foundations out from under Tk's feet and rewrite things so that it
  36.   used the low level drawing & event handling of the local system.  This
  37.   looked like a lot of work on something with which I did not have a lot
  38.   of experience, but it would definitely be an interesting project.
  39.  
  40.   One of the far fetched ideas I had at that time was to talk with some
  41.   place like Software Tranformation (which already has a portable graphics
  42.   and events library) to see if they might want to have a product which
  43.   was a script-driven application writing system which was portable to
  44.   the world...
  45.  
  46.   A downside of this is the resulting windows wouldn't look like normal
  47.   windows.  Mac's have flat looking widgets while Tk's are 3d motif style.
  48.  
  49. - Wrapper to implement an interface to the native widgets using Tk (or
  50.   Tk-like) commands.  The `button' (et al) command would create a little data
  51.   structure which encapsulates the pointer returned by the native
  52.   windowing system into a local data structure.  Other structure would
  53.   be set up to turn native events into whatever we'd need to drive
  54.   the script.
  55.  
  56.   But this also looked to be a big project.  The resulting programs would
  57.   look like native programs though ...
  58.  
  59. - Write a native implementation of Xlib.  This by itself would be a big
  60.   project, but once done Tk would have instant portability to that
  61.   system.
  62.  
  63.   Fortunately we didn't need to write our own Xlib as we've found one
  64.   for DOS.  Unfortunately it's been taking awhile to port that Xlib
  65.   to the compiler we have on DOS.
  66.  
  67.  
  68. <- David Herron <david@twg.com> (work) <david@davids.mmdf.com> (home)
  69. <-
  70. <- During the '80s Usenet's mantra was: "Not all the world's a VAX".
  71. <- During the '90s I hope it becomes:   "Not all the world's DOS (ick)".
  72.