Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. proc get_widgets {{start_path .}} {
  2. global widgets
  3. if {[string equal $start_path .]} {
  4. catch {unset widgets}
  5. }
  6. set ws [winfo children $start_path]
  7. add_widget $ws
  8. foreach w $ws {
  9. add_widget $w
  10. get_widgets $w
  11. }
  12. }
  13.  
  14. proc add_widget {w} {
  15. if {[winfo exist $w]} {
  16. upvar #0 widgets([winfo class $w]) type
  17. lappend type $w
  18. }
  19. }
  20.  
  21. proc new_config {cl ncfg val {map "*"}} {
  22. global widgets
  23. foreach widg $widgets($cl) {
  24. if {[string match $map $widg]} {
  25. $widg configure $ncfg $val
  26. option add $map.[lindex [$widg configure $ncfg] 2] $val
  27. }
  28. }
  29. }
  30.  
  31. get_widgets
  32. new_config Button -background green *tastebin*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement