All pastes #330461 Raw Edit

Miscellany

public text v1 · immutable
#330461 ·published 2007-01-27 22:47 UTC
rendered paste body
<?php

$window = new GtkWindow();
//$window->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();
?>