From 138380dbb65df8362e92f7d449cb0f538872f50a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 11 Dec 2002 13:55:49 +0000 Subject: add set_back_pixbuf() to let a widget paint itself a pixbuf in its background rather that doing this ourselves in rpmdrake or mcc --- perl-install/ugtk2.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'perl-install') 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); -- cgit v1.2.1