diff options
-rw-r--r-- | perl-install/ugtk.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/perl-install/ugtk.pm b/perl-install/ugtk.pm index b8b7b4206..25e3b9f0a 100644 --- a/perl-install/ugtk.pm +++ b/perl-install/ugtk.pm @@ -17,7 +17,9 @@ my $use_pixbuf; my $use_imlib; my $use_gnome; -BEGIN { +BEGIN { + require Gtk; + Gtk->init; eval { require Gtk::Gdk::Pixbuf; Gtk::Gdk::Pixbuf->init }; $use_pixbuf = $@ ? 0 : 1; eval { require Gtk::Gdk::ImlibImage; Gtk::Gdk::ImlibImage->init }; @@ -26,8 +28,6 @@ BEGIN { $use_gnome = $@ ? 0 : 1; } -use Gtk; - use c; use log; use common; @@ -752,8 +752,8 @@ sub gtkcreate_png_pixbuf { sub gtkcreate_png { my ($f) = shift; - $f =~ m|.png$| or $f = "$f.png"; - if ($f !~ /\//) { -e "$_/$f" and $f = "$_/$f", last foreach icon_paths() } + $f =~ /\.png$/ or $f .= '.png'; + if ($f !~ /^\//) { -e "$_/$f" and $f = "$_/$f", last foreach icon_paths() } if ($use_imlib) { my $im = Gtk::Gdk::ImlibImage->load_image($f) or die "gtkcreate_png: missing png file $f"; $im->render($im->rgb_width, $im->rgb_height); |