##-- Making the generic dialog for the messages to display --#
sub show_dialog {
	my ($title,$message,$endprog) = @_;
	my $dialog = new Gtk::Window("toplevel");
	if ($endprog == $true) {
		$dialog->signal_connect("delete_event",sub{Gtk->exit(0);});
	}
	else {
		$dialog->signal_connect("delete_event",sub{$dialog->destroy();});
	}
	$dialog->title($title);
	$dialog->border_width(0);
	$dialog->set_default_size(100,80);
	my $table = new Gtk::Table(2,1,$false);
	$dialog->add ($table);
	my $topframe = new Gtk::Frame ();
    $table->attach_defaults($topframe, 0,1,0,1);
	$topframe->show();
	my $label = new Gtk::Label ($message);
    $topframe->add($label);
    $topframe->border_width(1);
	$label->show();
	my $botframe = new Gtk::Frame ();
	my $button;
	if ($endprog == $true) {
			$button = new Gtk::Button('Exit');
			$button->signal_connect("clicked",sub{Gtk->exit(0);});
	}
	else {
    		$button = new Gtk::Button('Close');
			$button->signal_connect("clicked",sub{$dialog->destroy();});
	}
    $button->signal_connect("clicked", sub{$dialog->destroy()});
	$button->border_width(3);
    $table->attach_defaults($botframe, 0,1,1,2);
	$botframe->add($button);
    $botframe->border_width(1);
	$botframe->show();
    $button->show();
	$table->show();
	$dialog->show();
}
