From 8d901d9fbca6686495c059151757aea193066995 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 2 Feb 2001 16:35:23 +0000 Subject: (gtkcreate_xpm): error handling with error message --- perl-install/my_gtk.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 0b4d42923..73d989a5b 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -19,7 +19,7 @@ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ]; use Gtk; use c; use log; -use common qw(:common :functional); +use common qw(:common :functional :file); my $forgetTime = 1000; #- in milli-seconds $border = 5; @@ -63,7 +63,7 @@ sub new { $::WizardTable->attach($draw2, 0, 1, 1, 2, 'fill', 'fill', 0, 0); $::WizardTable->attach($draw3, 1, 2, 0, 1, 'fill', 'fill', 0, 0); $::WizardWindow->show_all; - my_gtk::flush(); + flush(); } $::WizardTable->attach($o->{window}, 1, 2, 1, 2, {'fill', 'expand'}, {'fill', 'expand'}, 0, 0); } @@ -73,7 +73,7 @@ sub new { $o->{rwindow} = $o->{window}; defined($::Plug) or $::Plug = new Gtk::Plug ($::XID); $::Plug->show; - my_gtk::flush(); + flush(); $::Plug->add($o->{window}); $o; } @@ -262,7 +262,10 @@ sub gtkctree_children { @l; } -sub gtkcreate_xpm { my $w = shift; Gtk::Gdk::Pixmap->create_from_xpm($w->window, $w->style->bg('normal'), @_) } +sub gtkcreate_xpm { + my ($w, $f) = @_; + Gtk::Gdk::Pixmap->create_from_xpm($w->window, $w->style->bg('normal'), $f) or die "gtkcreate_xpm: missing pixmap file $f"; +} sub xpm_d { my $w = shift; Gtk::Gdk::Pixmap->create_from_xpm_d($w->window, undef, @_) } sub gtkxpm { new Gtk::Pixmap(gtkcreate_xpm(@_)) } -- cgit v1.2.1