home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09962.iso / vrml / cp2b2x.exe / DATA.Z / sayings.tcl < prev    next >
Text File  |  1996-04-23  |  2KB  |  38 lines

  1. # sayings.tcl --
  2. #
  3. # This demonstration script creates a listbox that can be scrolled
  4. # both horizontally and vertically.  It displays a collection of
  5. # well-known sayings.
  6. #
  7. # @(#) sayings.tcl 1.1 95/05/26 15:56:38
  8.  
  9. set w .sayings
  10. catch {destroy $w}
  11. toplevel $w
  12. wm title $w "Listbox Demonstration (well-known sayings)"
  13. wm iconname $w "sayings"
  14. positionWindow $w
  15.  
  16. label $w.msg -font $font -wraplength 4i -justify left -text "The listbox below contains a collection of well-known sayings.  You can scan the list using either of the scrollbars or by dragging in the listbox window with button 2 pressed."
  17. pack $w.msg -side top
  18.  
  19. frame $w.buttons
  20. pack  $w.buttons -side bottom -expand y -fill x -pady 2m
  21. button $w.buttons.dismiss -text Dismiss -command "destroy $w"
  22. button $w.buttons.code -text "See Code" -command "showCode $w"
  23. pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
  24.  
  25. frame $w.frame -borderwidth 10
  26. pack $w.frame -side top -expand yes -fill y
  27.  
  28. scrollbar $w.frame.yscroll -command "$w.frame.list yview"
  29. scrollbar $w.frame.xscroll -orient horizontal \
  30.     -command "$w.frame.list xview"
  31. listbox $w.frame.list -width 20 -height 10 -setgrid 1 \
  32.     -yscroll "$w.frame.yscroll set" -xscroll "$w.frame.xscroll set"
  33. pack $w.frame.yscroll -side right -fill y
  34. pack $w.frame.xscroll -side bottom -fill x
  35. pack $w.frame.list -expand yes -fill y
  36.  
  37. $w.frame.list insert 0 "Waste not, want not" "Early to bed and early to rise makes a man healthy, wealthy, and wise" "Ask not what your country can do for you, ask what you can do for your country" "I shall return" "NOT" "A picture is worth a thousand words" "User interfaces are hard to build" "Thou shalt not steal" "A penny for your thoughts" "Fool me once, shame on you;  fool me twice, shame on me" "Every cloud has a silver lining" "Where there's smoke there's fire" "It takes one to know one" "Curiosity killed the cat" "Take this job and shove it" "Up a creek without a paddle" "I'm mad as hell and I'm not going to take it any more" "An apple a day keeps the doctor away" "Don't look a gift horse in the mouth"
  38.