Posted to tcl by emiliano at Tue Dec 30 15:04:05 GMT 2008view raw

  1. package require Tk
  2.  
  3. pack [ttk::notebook .nb -style Plain.TNotebook] -side right -fill both -expand 1
  4. pack [ttk::treeview .tv -show tree] -fill both
  5.  
  6.  
  7. foreach theme [ttk::style theme names] {
  8. ttk::style theme settings $theme {
  9. ttk::style layout Plain.TNotebook.Tab null
  10. ttk::style layout Plain.TNotebook null
  11. }
  12. .tv insert {} end -id $theme -text $theme
  13. .nb insert end [ttk::frame .nb.$theme]
  14. pack [label .nb.$theme.label -bg white -text "I'm theme $theme"] \
  15. -expand 1 -fill both -padx 20 -pady 20
  16.  
  17. }
  18.  
  19. bind .tv <<TreeviewSelect>> \
  20. {.nb select .nb.[ttk::setTheme [%W select]] }
  21.