Posted to tcl by schelte at Sat Jan 04 16:38:44 GMT 2014view raw

  1. wm geometry . 650x450;
  2. ttk::notebook .nb -width 600 -height 400
  3. .nb add [frame .nb.f1 -bg wheat] -text "First tab"
  4.  
  5. .nb add [frame .nb.f2 -class TNotebookT] -text "Second tab"
  6. button .nb.f2.b1 -textvariable c(co) -command change_color
  7. pack .nb.f2.b1 -side left -anchor n
  8. set c(co) [string trim $c(co)]
  9. button .nb.f2.bb1 -text " " -command "change_color_single $c(co)"
  10. pack .nb.f2.bb1 -side left -anchor n
  11. label .nb.f2.t1 -text "One color at a time"
  12. pack .nb.f2.t1 -side bottom -anchor n
  13.  
  14. .nb add [frame .nb.f3 -bg wheat] -text "Third tab"
  15. label .nb.f3.l1 -text "All the colors in one 'text' item"
  16. pack .nb.f3.l1 -side bottom -anchor e
  17.  
  18. scrollbar .nb.f3.sbar -orient vertical -command [list .nb.f3.tb yview]
  19. pack .nb.f3.sbar -side right -fill y
  20. text .nb.f3.tb -yscrollcommand [list .nb.f3.sbar set] -width 40 -height 20
  21. pack .nb.f3.tb -side left -anchor e -fill both -expand 1
  22.  
  23. # fill_text
  24.  
  25. .nb add [frame .nb.f4 -bg wheat] -text "Fourth tab"
  26. pack .nb
  27.