App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/misc/param_widgets_pink.pm  view on Meta::CPAN

	if ( $button_w_aref && $settings_aref ) {

		for ( my $i = $first ; $i < $length ; $i++ ) {

			@$button_w_aref[$i]->configure(
				-onvalue          => 'on',
				-offvalue         => 'off',
				-selectcolor      => 'green',
				-activebackground => 'red',
				-background       => 'red',
				-variable         => \@$settings_aref[$i],
			);
		}
	}
	else {
		print(
			"param_widgets_color, redisplay_check_buttons missing parameters\n"
		);
	}
	return ();
}

=head2 sub redisplay_labels 

  print("1. redisplay, resdisplay_labels, text is @{$label_array_ref}[$i]\n");
  print("redisplay, resdisplay_labels, i is $i\n");
  print("2. redisplay, resdisplay_labels, text is @{$LSU->{_label_array_ref}}[$i]\n");

=cut

sub redisplay_labels {
	my ($self)        = @_;
	my $labels_w_aref = $param_widgets_color_href->{_labels_w_aref};
	my $labels_aref   = $param_widgets_color_href->{_labels_aref};
	my $first         = $param_widgets_color_href->{_first_idx};
	my $length        = scalar @{ $param_widgets_color_href->{_labels_aref} };

	# print("param_widgets_color,redisplay_labels, length=$length\n");
	# print("param_widgets_color,redisplay_labels, first=$first\n");
	if ($labels_w_aref) {
		for ( my $i = $first ; $i < $length ; $i++ ) {

		# print("i:$i   param_widgets_color,redisplay_labels length:$length\n");
		# print(" text is @{$labels_aref}[$i]\n");

			@$labels_w_aref[$i]->configure( -text => @$labels_aref[$i], );
		}
	}
	else {
		print(
"param_widgets_color,redisplay labels, Warning parameters or labels_w_aref missing \n"
		);
	}
	return ();
}

=head2 sub redisplay_values 

  display parameter values without quotes
  although internally we always have quotes for strings
  and no quotes if the value looks like a number
  
  i/p: 2 array references
  o/p: array reference

  N.B. This is an ENTRY widget
  textvariables must be a reference in order
  for -validatecommand to work. BEWARE!
  
  For the Entry widget do not alter the 
  textvariable directly while using
  validatecommand but instead
  indirectly delete the textvaribale and replace it using
  the insert method
  
  &_changes is invoked if
  there is a new selection after an entry change
  or even just if redisplay is selected
 _changes returns a 0 to invoke an error check
  In main, focus is forced to follows the mouse
  so focus will change whenever mouse moves to a new
  widget. That means the _changes will be invoked at every
  shift of the mouse to a new widget.
  
  use App::SeismicUnixGui::misc::control '0.0.3' to remove terminal quotes for values, only for display purposes;
  when later read again the values will be given quotes if they
  do not look like a number-- this occurs in a superclass
  
  my $length 				= $param_widgets_color_href->{_length};
  print("param_widgets_color, redisplay_values, length is $length\n");

=cut 

sub redisplay_values {

	my ($self)        = @_;
	my $values_w_aref = $param_widgets_color_href->{_values_w_aref};
	my $values_aref   = $param_widgets_color_href->{_values_aref};
	my $first         = $param_widgets_color_href->{_first_idx};
	my $length        = scalar @{ $param_widgets_color_href->{_values_aref} };

	#	print("param_widgets_color, redisplay_values, length is $length\n");
	#   print("param_widgets_color, redisplay_values, first is $first =0 \n");

	if (   length($values_w_aref)
		&& length($values_aref) )
	{

		for ( my $i = $first ; $i < $length ; $i++ ) {

# print("1. param_widgets_color,redisplay_values,chkbtn @{$param_widgets_color_href->{_check_buttons_settings_aref}}[$i]\n");
# print("param_widgets_color, redisplay_values, i is $i\n");
#			print("1. param_widgets_color, redisplay_values, value is @{$values_aref}[$i]\n");

			@{$values_aref}[$i] =
			  $control->get_no_quotes( @{$values_aref}[$i] );

# print("2. param_widgets_color, redisplay_values, quoteless value is @{$values_aref}[$i]\n");

			@$values_w_aref[$i]->configure(
				-validate        => 'focus',



( run in 1.541 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )