proc tk_syscolorchange {w} {
    foreach win [winfo children $w] {
	tk_syscolorchange $win
    }

    set config [$w config]
    foreach optlist $config {
	set opt [lindex $optlist 0]
	set do 0
	switch -- $opt {
	    -activebackground {set do 1}
	    -activeforeground {set do 1}
	    -background {set do 1}
	    -disabledforeground {set do 1}
	    -foreground {set do 1}
	}
	if {$do == 1} {
	    $w config $opt [lindex $optlist 4]
	}
    }
}
