ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/lib/Gtk2/CV.pm
(Generate patch)

Comparing CV/lib/Gtk2/CV.pm (file contents):
Revision 1.3 by root, Mon Nov 3 16:44:19 2003 UTC vs.
Revision 1.4 by root, Fri Nov 7 02:41:06 2003 UTC

6 6
7XSLoader::load "Gtk2::CV", $VERSION; 7XSLoader::load "Gtk2::CV", $VERSION;
8 8
9use Gtk2; 9use Gtk2;
10 10
11sub require_image { 11sub find_rcfile {
12 my $path; 12 my $path;
13 13
14 for (@INC) { 14 for (@INC) {
15 $path = "$_/Gtk2/CV/images/$_[0]"; 15 $path = "$_/Gtk2/CV/$_[0]";
16 last if -r $path; 16 return $path if -r $path;
17 } 17 }
18 18
19 eval { new_from_file Gtk2::Gdk::Pixbuf $path } 19 die "FATAL: can't find required file $_[0]\n";
20 or die "can't find image $_[0] in \@INC"; 20}
21
22sub require_image {
23 new_from_file Gtk2::Gdk::Pixbuf find_rcfile "images/$_[0]";
21} 24}
22 25
231; 261;
24 27

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines