home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activetcltk / ActiveTcl8.3.4.1-8.win32-ix86.exe / ActiveTcl8.3.4.1-win32-ix86 / demos / IWidgets / scrolledframe < prev    next >
Encoding:
Text File  |  2001-10-22  |  812 b   |  30 lines

  1. # ----------------------------------------------------------------------
  2. #  DEMO: scrolledframe in [incr Widgets]
  3. # ----------------------------------------------------------------------
  4. package require Iwidgets 4.0
  5.  
  6. option add *textBackground seashell
  7.  
  8. iwidgets::scrolledframe .sf -width 4i -height 2i -labeltext "Scrolledframe"
  9. pack .sf
  10.  
  11. set win [.sf childsite]
  12.  
  13. set all ""
  14. foreach option [.sf configure] {
  15.     if {[llength $option] == 5} {
  16.         set name [lindex $option 0]
  17.         set val [lindex $option end]
  18.  
  19.         set entry [iwidgets::entryfield $win.#auto]
  20.         pack $entry -fill x
  21.  
  22.         $entry configure -labeltext $name \
  23.             -command ".sf configure $name \[$entry get\]"
  24.         $entry insert 0 $val
  25.  
  26.         lappend all $entry
  27.     }
  28. }
  29. eval iwidgets::Labeledwidget::alignlabels $all
  30.