diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-12-11 13:55:49 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-12-11 13:55:49 +0000 |
commit | 138380dbb65df8362e92f7d449cb0f538872f50a (patch) | |
tree | 866883e0d3648d35e52eebce3f364db46aede625 /perl-install | |
parent | 080c146b346070074a8d326a1955f240ee921702 (diff) | |
download | drakx-138380dbb65df8362e92f7d449cb0f538872f50a.tar drakx-138380dbb65df8362e92f7d449cb0f538872f50a.tar.gz drakx-138380dbb65df8362e92f7d449cb0f538872f50a.tar.bz2 drakx-138380dbb65df8362e92f7d449cb0f538872f50a.tar.xz drakx-138380dbb65df8362e92f7d449cb0f538872f50a.zip |
add set_back_pixbuf() to let a widget paint itself a pixbuf in its
background rather that doing this ourselves in rpmdrake or mcc
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/ugtk2.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 2c97dad0e..9fd5fe589 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -14,7 +14,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @icon_paths $force_center $force_focus gtkhide gtkdestroy gtkflush gtkset_mousecursor gtkset_mousecursor_normal gtkset_markup gtkset_mousecursor_wait gtkappend_text gtkprepend_text gtkinsert_text gtkroot gtksetstyle) ], helpers => [ qw(add2notebook add_icon_path n_line_size fill_tiled fill_tiled_coords string_size - get_text_coord gtkcolor gtkset_background gtkfontinfo gtkcreate_img gtkcreate_pixbuf) ], + get_text_coord gtkcolor gtkset_background gtkfontinfo gtkcreate_img gtkcreate_pixbuf set_back_pixbuf) ], create => [ qw(create_box_with_title create_adjustment create_scrolled_window create_hbox create_vbox create_dialog destroy_window create_factory_menu create_menu create_notebook create_packtable create_vpaned create_hpaned create_okcancel) ], @@ -533,6 +533,15 @@ sub gtkfontinfo { %fontinfo; } +sub set_back_pixbuf { + my ($widget, $pixbuf) = @_; + my $window = $widget->window; + my ($width, $height) = ($pixbuf->get_width, $pixbuf->get_height); + my $pixmap = Gtk2::Gdk::Pixmap->new($window, $width, $height, $window->get_depth); + $pixbuf->render_to_drawable($pixmap, $widget->style->fg_gc('normal'), 0, 0, 0, 0, $width, $height, 'none', 0, 0); + $window->set_back_pixmap($pixmap, 0); +} + sub fill_tiled_coords { my ($widget, $pixbuf, $x_back, $y_back, $width, $height) = @_; my ($x2, $y2) = (0, 0); |