App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/big_streams/immodpg.pm  view on Meta::CPAN

		}

	}
	elsif ( length( $immodpg->{_control_layer_external} ) == 0 ) {

		$result = 1;

#		print("CASE 2immodpg, get_control_layer, empty string layer updated to $result\n");

	}
	else {
		print("immodpg, get_control_layer, unexpected value\n");
	}

	return ($result);
}

=head2 sub get_max_index
 
max index = number of input variables -1
 
=cut

sub get_max_index {
	my ($self) = @_;
	my $max_index = 14;

	return ($max_index);
}

=head2 sub initialize_messages
Create widgets that show messages
Show warnings or errors in a message box
Message box is defined in main where it is
also made invisible (withdraw)
Here we turn on the message box (deiconify, raise)
The message does not release the program
until OK is clicked and wait variable changes from yes 
to no.

=cut

sub initialize_messages {

	my ($self) = @_;

	my $arial_14_b = ( $immodpg->{_mw} )->fontCreate(
		'arial_14_b',
		-family => 'arial',
		-weight => 'bold',
		-size   => -14
	);

=head2 message box
withdraw temporarily while filling
with widgets

=cut 

	$immodpg->{_message_box_w} =
	  $immodpg->{_mw}->Toplevel( -background => $var_L_SU->{_my_yellow}, );
	$immodpg->{_message_box_w}->withdraw;

	$immodpg->{_message_box_w}->geometry( $var_L_SU->{_message_box_geometry} );

	$immodpg->{_message_upper_frame} = $immodpg->{_message_box_w}->Frame(
		-borderwidth => $var_L_SU->{_no_borderwidth},
		-background  => $var_L_SU->{_my_yellow},
	);
	$immodpg->{_message_lower_frame} = $immodpg->{_message_box_w}->Frame(
		-borderwidth => $var_L_SU->{_no_borderwidth},
		-background  => $var_L_SU->{_my_yellow},
		-height      => '10',
	);
	$immodpg->{_message_label_w} = $immodpg->{_message_upper_frame}->Label(
		-background => $var_L_SU->{_my_yellow},
		-font       => $arial_14_b,
		-justify    => 'left',
	);

	$immodpg->{_message_box_wait}  = $var_L_SU->{_yes};
	$immodpg->{_message_ok_button} = $immodpg->{_message_box_w}->Button(
		-text    => "ok",
		-font    => $arial_14_b,
		-command => sub {
			$immodpg->{_message_box_w}->grabRelease;
			$immodpg->{_message_box_w}->withdraw;
		},
	);

=head2 Pack message box
This Toplevel window has 
geometry that is independent
of the main window widget.
Upper frame contains message.
Lower frame contains ok button.

=cut

	$immodpg->{_message_upper_frame}->pack();
	$immodpg->{_message_label_w}->pack( -side => 'top', );
	$immodpg->{_message_lower_frame}->pack( -side => 'top', );

	$immodpg->{_message_ok_button}->pack(
		-side   => "top",
		-fill   => 'none',
		-expand => 0,
	);

	return ();
}

=head2 sub initialize_model

Load into namespace the immodpg model to 
establish the first set of layers
their velocities and thickness

=cut

sub initialize_model {
	my ($self) = @_;

	my ( $refVPtop, $refVPbot, $ref_dz, $error_switch ) = _get_initial_model();

	if (   length($refVPtop)
		&& length($refVPbot)
		&& length($ref_dz)
		&& length($error_switch) )
	{

		_set_initialVp_dz( $refVPtop, $refVPbot, $ref_dz, $error_switch );

	}
	else {
		print(" immodpg, L5046, missing or corrupt variables \n");



( run in 0.587 second using v1.01-cache-2.11-cpan-f56aa216473 )