home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1851 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.5 KB  |  96 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!cwe
  3. From: cwe@dront.nada.kth.se (Christian Wettergren)
  4. Subject: Wanted: Geometry handlers like TeX Glue...
  5. Message-ID: <1992Nov17.150414.23258@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: dront.nada.kth.se
  8. Organization: Royal Institute of Technology, Stockholm, Sweden
  9. Date: Tue, 17 Nov 1992 15:04:14 GMT
  10. Lines: 84
  11.  
  12. Hello!
  13.  
  14. First, I would like to praise Tk. It's everything I ever
  15. wanted. Thanks everyone who has developed it!
  16.  
  17. I have one "idea" about how Tk might improve though. 
  18.  
  19. I think the weakest part of Tk is it's geometry handlers; 'pack'
  20. and 'place'. Of course, almost anything is possible to create
  21. with pack/frame, but it rapidly becomes awkward. (I don't
  22. think other toolboxes are substantially better at managing these
  23. things, but I'm not a very experienced X-hacker.)
  24.  
  25. I would love to have something like TeX Glue for placing objects.
  26. I know, TeX glue does not provide enough flexibility, since it
  27. only handles the space between objects, not the objects' sizes.
  28. But I would like to have something in the same spirit. 
  29.  
  30. At KTH, a Scheme to X toolbox has been developed that has some
  31. of these capabilities, namely SCIX/STOX. Maybe some of these 
  32. features could be transferred to Tk?
  33.  
  34. From Section 'Boxes and Glue' in 'STOX, the Scheme Toolkit for X'
  35. (not transcribed exactly, somewhat shortened):
  36.  
  37.    "STOX includes a TeX-based scheme for placement of widgets. 
  38.     The classes concerned are hglue, vglue, hbox-aux and 
  39.     vbox-aux. None of these are normally used directly. Instead 
  40.     they are accessed through a number of convenience functions.
  41.     (see below).
  42.  
  43.     The hglue constructor accepts (pixel measures):
  44.     'width, 'height, 'borderwidth
  45.     'stretch        strechability ('inf possible)
  46.     'shrink        shrinkability ('inf possible)
  47.  
  48.     vglue accepts the same keywords, but with the obvious 
  49.     changes in meaning.
  50.  
  51.     The hbox-aux accepts the following keywords:
  52.     'contents        The contents to keep track of. Default:
  53.             (hglue 'stretch 'inf)
  54.     'width        Default: total width of contents
  55.     'height        Default: max of height of contents
  56.     'x, 'y        position of the box
  57.  
  58.     'natural-height    returns the height/width of the box 
  59.     'natural-width     unstretched and unshrinked.
  60.     'set-width!        Sets the width to new width/height
  61.     'move        Changes position of the box
  62.     'arrange        Reorders the box 
  63.  
  64.     vbox-aux accepts the same keywords, but with the obvious
  65.     changes in meaning.
  66.     
  67.     Convenience functions:
  68.     (hfill)        (hglue 'make 'stretch 'inf)
  69.     (hss)        (hglue 'make 'stretch 'inf 'shrink 'inf)
  70.     (hskip amount)    (hglue 'make 'width amount)
  71.     (hbox [c])         (hbox-aux 'make ['contents c])
  72.     (hbox-to w [c])    (hbox-aux 'make 'width w ['contents c])
  73.  
  74.     The same but in vertical direction is of course defined too.
  75.  
  76.     The practical use of this approach to widget layout can be 
  77.     studied in the example applications and (for the non-TeX-
  78.     speaking) also in Knuth's 'The TeXbook'."
  79.  
  80. (Transcribed without permission. Sorry Johan and Haakan, I'll
  81. make it up to you :-) )
  82.   
  83. What do others think about Tk and geometry handlers? Would it 
  84. be hard or inefficient to do this? Am I missing something
  85. obvious here?
  86.  
  87.  
  88. Regards,
  89.     Christian Wettergren, cwe@nada.kth.se
  90.  
  91. -- 
  92. --------------------------------------------------------------------------
  93. Christian Wettergren, cwe@nada.kth.se, 08 - 641 14 02
  94. Hi! I am a mutating signature viruSTOMP!eacheSTOMP!e too!
  95. STOMP! STOMP! STOMP! SigVirCatcher was here!
  96.