Re: Background image for a window




On Feb 9, 2005, at 12:20 AM, Chris Debenham - PTS Engineer wrote:

I want to put an image in the background of a window with text labels over it.
In Gtk1 i used:
$window_style->bg_pixmap('normal', $pixmap);
$window->window->set_back_pixmap($pixmap, 0);

but this fails in GTK2
(error message:"Usage: Gtk2::Style::bg_pixmap(style, state)")

Is there a better/proper way to do this?

setting the pixmap in the style (with the duplicate style and attach and all that) should be sufficient; but, as you see, we have that bound only as an accessor, not as a mutator. attached is a patch that would make that work.

just setting the backing pixmap on the gdk window will not really be enough, because the widget style will paint right over top of it.

Attachment: bg_pixmap.patch
Description: Binary data




--
I think it worked on the Wiley Coyote model of project management - if
at any point you looked down and realised what you were doing was
impossible then you'd instantly fail.
  -- Simon Wistow


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]