#
#  Error.pm
#  --set up error handlers for mchange
#

package Mchange::Error;

use CSL::Gtk2;
use CSL::Gnome2;
use Gnome2;

sub new {

  my $class = shift;
  my $self = { };
  return bless $self, $class;

}

#
#  gui_err
#  --return error in gui error form
#

sub gui_err {

  my ($self, $main_app_window, $message, $type, $buttons) = @_;
  my $dialog = Gtk2::MessageDialog->new ($main_app_widow,
                                    'destroy-with-parent',
                                    $type,
                                    $buttons,
                                    $message);
   
    my $response = $dialog->run;

    $dialog->destroy;

    return $response
}

#
#  text_err
#  --return the error in text form
#

sub text_err {

  my ( $self, $err ) = @_;

  print "$err\n";
  return "error";

}


1;
