sub set_bg{ my $pixbuff = Gtk2::Gdk::Pixbuf->new_from_file("1Zen16.png"); #set the new pixbuff in a vbox my $gdkwindow = $vbox1->window; # how to get the drawable, $widget->get_parent_window # did not work for me # although the drawable seems to have # the identical hash # ???? my ($drawable, $x_offset, $y_offset) = $gdkwindow->get_internal_paint_info; print "$drawable, $x_offset, $y_offset\n"; my $gc = Gtk2::Gdk::GC->new ($gdkwindow, undef); print "$gc\n"; $pixbuff->render_to_drawable($drawable, $gc, 0,0,0,0,500,430,'normal',0,0); #this was needed, to make the image actually change Gtk2->main_iteration while Gtk2->events_pending; $window->show_all(); return FALSE; }