home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / blt1.000 / blt1 / blt-1.7-for-STk / demos / htext.stk < prev    next >
Encoding:
Text File  |  1994-07-26  |  1.3 KB  |  44 lines

  1. #!../test-blt -f
  2.  
  3. ;; Some redefinition to make the demo working.
  4. ;; No care has been taken for trying to make this demo working well since
  5. ;; Tk 4.0 will enhance greatly the text widget. 
  6. ;; This is just for playing with the BLT hyper text widget.
  7. ;; If this widget is really needed, I could try to provide a better support
  8.  
  9. (require "blt")
  10.  
  11. (define global list)            ;; Kludge
  12. (define blt_htext{line} #f)        ;; Kludge
  13. (define blt_htext{widget} '.htext)    ;; Kludge
  14. (define blt_htext{file} #f)        ;; Kludge
  15.  
  16.  
  17. (option 'add "*Blt_htext.foreground" "navyblue")
  18.  
  19. ;;; Create horizontal and vertical scrollbars
  20. (scrollbar '.vscroll :command ".htext 'yview " :orient 'vertical)
  21. (scrollbar '.hscroll :command ".htext 'xview " :orient 'horizontal)
  22.  
  23. ;;;; Create the hypertext widget 
  24. (blt_htext blt_htext{widget} :file "./htext.txt"
  25.                  :yscrollcommand ".vscroll 'set "
  26.                  :xscrollcommand ".hscroll 'set "
  27.                  :height '6i
  28.                  :yscrollunits '10m
  29.                  :xscrollunits '0.25i)
  30.  
  31. ;;;;
  32. ;;;; Use BLT_TABLE for placing widgets
  33. ;;;; 
  34. (blt_table *root*
  35.        .htext   "0,0" :fill 'both
  36.        .vscroll "0,1" :fill 'y
  37.        .hscroll "1,0" :fill 'x)
  38.  
  39. (blt_table 'row    *root* 'configure 1 :resize 'none)
  40. (blt_table 'column *root* 'configure 1 :resize 'none)
  41.  
  42. (wm 'maxsize *root* 1000 1000)
  43. (wm 'minsize *root* 0 0)
  44.