proc AddProgressWin { w } {
	global progressWins
	if ![info exists progressWins] {set progressWins $w;return}
	if {[lsearch $progressWins $w] == -1} {
		lappend progressWins $w
	}
}
proc DelProgressWin { w } {
	global progressWins
	foreach win $progressWins {
		if ![string match $win $w] {lappend n $win}
	}
	set progressWins $n
}
proc Working { } {
	global progressWins
	foreach w $progressWins {catch {SetWorking $w}}
}
proc Waiting { } {
	global progressWins
	foreach w $progressWins {catch {SetWaiting $w}}
}
proc mkInfoBar { w args } {
	global errorInfo errorCode WorkingMsg

	set text {}
	set bitmap {}
	set msg {Working...}
	if [catch {ParseArgs {:text :bitmap :msg} $args}] {
		error mkInfoBar $errorInfo $errorCode
	}

	set WorkingMsg($w) $msg
	frame $w
	label $w.progress
	pack append $w $w.progress "right padx 10 pady 10"

	if {$bitmap != {}} {
		label $w.bit -bitmap $bitmap
		pack append $w $w.bit "left padx 10 pady 10" \
	}
	if {$text != {}} {
		label $w.title -text $text
		pack append $w $w.title "left padx 10 pady 10" \
	}
	AddProgressWin $w
}


#
# Reverse - Reverse a window's foreground and background colors
#
# inputs:
#	win	window to Reverse
#
proc Reverse win {
	set b [$win configure -background ]
	set f [$win configure -foreground ]
	$win configure -background [lindex $f 4]
	$win configure -foreground [lindex $b 4]
}

#
# SetWorking - sets a .progress label to working
#
# inputs:
#	w	label window put "Working..." in Reverseerse video
#
proc SetWorking { w } {
	global WorkingMsg
	Reverse $w.progress
	$w.progress configure -text $WorkingMsg($w)
	update
}

#
# SetWaiting - sets a .progress label to waiting
#
# input:
#	w	label window clear
#	
proc SetWaiting { w } {
	Reverse $w.progress
	$w.progress configure -text ""
	update
}
