Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc get_widgets {{start_path .}} {
- global widgets
- if {[string equal $start_path .]} {
- catch {unset widgets}
- }
- set ws [winfo children $start_path]
- add_widget $ws
- foreach w $ws {
- add_widget $w
- get_widgets $w
- }
- }
- proc add_widget {w} {
- if {[winfo exist $w]} {
- upvar #0 widgets([winfo class $w]) type
- lappend type $w
- }
- }
- proc new_config {cl ncfg val {map "*"}} {
- global widgets
- foreach widg $widgets($cl) {
- if {[string match $map $widg]} {
- $widg configure $ncfg $val
- option add $map.[lindex [$widg configure $ncfg] 2] $val
- }
- }
- }
- new_config Button -background green *tastebin*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement