MkDirLis.tcl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  2. #
  3. # $Id: MkDirLis.tcl,v 1.4 2004/03/28 02:44:56 hobbs Exp $
  4. #
  5. # MkDirLis.tcl --
  6. #
  7. # This file implements the "Directory List" page in the widget demo
  8. #
  9. # This file has not been properly documented. It is NOT intended
  10. # to be used as an introductory demo program about Tix
  11. # programming. For such demos, please see the files in the
  12. # demos/samples directory or go to the "Samples" page in the
  13. # "widget demo"
  14. #
  15. #
  16. # Copyright (c) 1996, Expert Interface Technologies
  17. #
  18. # See the file "license.terms" for information on usage and redistribution
  19. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  20. #
  21. proc MkDirList {nb page} {
  22. set w [$nb subwidget $page]
  23. set name [tixOptionName $w]
  24. option add *$name*TixLabelFrame*label.padX 4
  25. tixLabelFrame $w.dir -label "tixDirList"
  26. tixLabelFrame $w.fsbox -label "tixExFileSelectBox"
  27. MkDirListWidget [$w.dir subwidget frame]
  28. MkExFileWidget [$w.fsbox subwidget frame]
  29. tixForm $w.dir -top 0 -left 0 -right %40 -bottom -1
  30. tixForm $w.fsbox -top 0 -left %40 -right -1 -bottom -1
  31. }
  32. proc MkDirListWidget {w} {
  33. set name [tixOptionName $w]
  34. message $w.msg \
  35. -relief flat -width 240 -anchor n\
  36. -text "The TixDirList widget gives a graphical representation of\
  37. the file system directory and makes it easy for the user\
  38. to choose and access directories."
  39. tixDirList $w.dirlist -options {
  40. hlist.padY 1
  41. hlist.width 25
  42. hlist.height 16
  43. }
  44. pack $w.msg -side top -expand yes -fill both -padx 3 -pady 3
  45. pack $w.dirlist -side top -padx 3 -pady 3
  46. }
  47. proc MkExFileWidget {w} {
  48. set name [tixOptionName $w]
  49. message $w.msg \
  50. -relief flat -width 240 -anchor n\
  51. -text {The TixExFileSelectBox widget is more user friendly \
  52. than the Motif style FileSelectBox.}
  53. tixExFileSelectBox $w.exfsbox -bd 2 -relief raised
  54. pack $w.msg -side top -expand yes -fill both -padx 3 -pady 3
  55. pack $w.exfsbox -side top -padx 3 -pady 3
  56. }