
proc update_button2 {board elem_num} {
	
	#-------------------------------------------#
	# Get the name of the button so we can find it on the screen    #
	#-------------------------------------------#
 	set but_name [get_button_name $board $elem_num]
 	
 	#------------------------------#
 	# Send down the command to the bottom     #
 	#------------------------------#
 	#send_alternate_but_down $board $elem_num
 	
 	
 	
 	#--------------------------------#
 	# Look for the button from the first screen 	#
 	#--------------------------------#
 	set vbut .ventana.editor.b$but_name
 	
 	if ![winfo exists $vbut] {
 		puts "button does not exist on screen 1"
 	} else {
 	
 		set state [get_button_state $board $elem_num]
       		if {$state == 1} {
       			$vbut configure -bg white
       			$vbut configure -activebackground white
       		} else {
       			set bclr [lindex [get_button_color_type $board $elem_num] 0]
       			if { $bclr == "" || $bclr == " "  } { set bclr grey }
       			$vbut configure -bg $bclr
       			$vbut configure -activebackground $bclr
       			#$vbut configure -bg grey
       			#$vbut configure -activebackground grey
       			      			
       		}	
 	
       	}
       	
 	#---------------------------------------------#
 	# Look for the button from the second screen 			#
 	#---------------------------------------------#
 	set vbut2 .ventana2.editor.b$but_name

 	
 	if ![winfo exists $vbut2] {
 		#puts "button does not exist on screen 2"
 		return
 	} else {
 	
 		set state [get_button_state $board $elem_num]
 	      	
 	      	
 	      	if {$state == 1} {
 	      		$vbut2 configure -bg white
 	      		$vbut2 configure -activebackground white
 	      	} else {
 	      		set bclr [lindex [get_button_color_type $board $elem_num] 0]
 	      		if { $bclr == "" || $bclr == " " } { set bclr grey }
 	      		$vbut2 configure -bg $bclr
 	      		$vbut2 configure -activebackground $bclr
 	      		#$vbut2 configure -bg grey
 	      		#$vbut2 configure -activebackground grey 	      		
       		}	
	}
       	
}



