set_size_request(100, 100); $button = new GtkButton('hello'); $window->add($button); $button->set_size_request(100, 100); $button->show_all(); $button->realize(); $button->map(); $child = $button->get_child(); $visual = $button->window->get_visual(); $pixmap = new GdkPixmap(null, 100, 100, $visual->depth); $button->fake_expose($pixmap); $child->show_all(); $child->realize(); $child->map(); $child->fake_expose($pixmap); // set background image $style = $window->get_style(); $style=$style->copy(); $style->bg_pixmap[Gtk::STATE_NORMAL]=$pixmap; $window->set_style($style); $window->connect_simple('destroy', array('Gtk','main_quit')); $button->hide(); $window->show(); Gtk::main(); ?>