home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 5 / hacker05 / 05_HACK_05.ISO / programacao / freewrap / TCLLIBsampleApp.exe / sample / tcllib / tcllib_demo.tcl < prev    next >
Encoding:
Text File  |  2002-01-27  |  1.1 KB  |  28 lines

  1. # tcllib sample program.
  2. #
  3. # By Dennis R. LaBelle    - January 27, 2002
  4. #
  5. # This program demonstrates a method of wrapping tcllib with freeWrap 5.1 and later.
  6. #
  7.  
  8. catch {console show}
  9.  
  10. # Set a variable specifying the original top level directory of package at the time of wrapping.
  11. # Remember, file paths are now case sensitive under both Unix and Windows.
  12. set topdir /tkprogs/freeWrap/sample/tcllib/tcllib1.0
  13.  
  14. # Add a few directories to auto_path so TCL can find our wrapped tcllib packages.
  15. global auto_path
  16. foreach path {{} base64 cmdline counter csv fileutil ftp ftpd html htmlparse javascript log math md5 mime ncgi nntp pop3 profiler report sha1 struct textutil uri} {
  17.         lappend auto_path [file join $topdir $path]
  18.       }
  19.  
  20. # run the demo - use one of the tcllib commands
  21. package require textutil
  22. set dtemp {  ab c }
  23. set result "Trimming \{$dtemp\} produces \{[::textutil::trim $dtemp]\}"
  24. label .label1 -textvariable result -background slategray4 -foreground white -relief ridge -font {Helv 12}
  25. pack .label1 -pady 4
  26. button .btn1 -text Quit -command exit
  27. pack .btn1
  28.