summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-02-19 10:02:29 +0000
committerdamien <damien@mandriva.com>2002-02-19 10:02:29 +0000
commitad292f444c41369605e4148d04acea65a8a8fc05 (patch)
tree412af7a44805cdff860ed2b1146a98c1c63c6bdd /perl-install
parent1504a603f67464690411aa276745e8cdb941b30e (diff)
downloaddrakx-backup-do-not-use-ad292f444c41369605e4148d04acea65a8a8fc05.tar
drakx-backup-do-not-use-ad292f444c41369605e4148d04acea65a8a8fc05.tar.gz
drakx-backup-do-not-use-ad292f444c41369605e4148d04acea65a8a8fc05.tar.bz2
drakx-backup-do-not-use-ad292f444c41369605e4148d04acea65a8a8fc05.tar.xz
drakx-backup-do-not-use-ad292f444c41369605e4148d04acea65a8a8fc05.zip
new icon handler
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/my_gtk.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 6c5d54791..0a0c721e0 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -363,21 +363,27 @@ sub gtkctree_children {
@l;
}
+my @icon_paths = ($ENV{SHARE_PATH}, "$ENV{SHARE_PATH}/libDrakX/pixmaps", "pixmaps");
+
+sub add_icon_path { @icon_paths = uniq(@icon_paths, @_) }
+
sub gtkcreate_xpm {
my ($w, $f) = @_;
$f =~ m|.xpm$| or $f="$f.xpm";
- if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach $ENV{SHARE_PATH}, "$ENV{SHARE_PATH}/libDrakX/pixmaps", "pixmaps" }
+ if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach @icon_paths }
my @l = Gtk::Gdk::Pixmap->create_from_xpm($w->window, $w->style->bg('normal'), $f) or die "gtkcreate_xpm: missing pixmap file $f";
@l;
}
+
sub gtkcreate_png {
- my ($f) = @_;
+ my ($f) = shift;
$f =~ m|.png$| or $f="$f.png";
- if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach $ENV{SHARE_PATH}, "$ENV{SHARE_PATH}/icons", "$ENV{SHARE_PATH}/libDrakX/pixmaps", "pixmaps" }
+ if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach @icon_paths }
my $im = Gtk::Gdk::ImlibImage->load_image($f) or die "gtkcreate_png: missing png file $f";
$im->render($im->rgb_width, $im->rgb_height);
($im->move_image(), $im->move_mask);
}
+
sub gtkbuttonset {
my ($button, $str) = @_;
$button->child->destroy;