home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2005 March / PCWELT_3_2005.ISO / pcwsoft / framework-2.2.exe / scrolledlistbox < prev    next >
Encoding:
Text File  |  2003-09-01  |  791 b   |  31 lines

  1. # ----------------------------------------------------------------------
  2. #  DEMO: scrolledlistbox in [incr Widgets]
  3. # ----------------------------------------------------------------------
  4. package require Iwidgets 4.0
  5.  
  6. option add *textBackground seashell
  7. . configure -background white
  8.  
  9. iwidgets::scrolledlistbox .slb -labeltext "Scrolledlistbox" \
  10.     -vscrollmode dynamic -hscrollmode none \
  11.     -selectmode single \
  12.     -labelpos nw -selectioncommand {
  13.         puts "click: [.slb getcurselection]"
  14.     }
  15.  
  16. pack .slb -padx 4 -pady 4
  17.  
  18. .slb insert 0 Hello World! Cruel
  19. .slb delete "Hello"
  20. .slb insert 0 "Goodbye"
  21.  
  22. button .add -text "Add" -command {
  23.     .slb insert end "Goodbye!"
  24. }
  25. pack .add -padx 4 -pady 4
  26.  
  27. button .del -text "Delete" -command {
  28.     .slb delete 0
  29. }
  30. pack .del -padx 4 -pady 4
  31.