Re: Background image in a window



On Sat, 6 Dec 2008 09:55:55 +0530
"Harinandan S" <harinandans gmail com> wrote:

>Hi All,
>
>How to set background image to a window? In my window there are few buttons.
>I want to set background image to the entire window? I googled but couldnt
>find much help.
>
>Regards,
>Harinandan S
Hi, 
I use Perl and it was tough to figure that one out, because of the theme
engine, and the need to override it. If you use a pixmap based theme, it
is tenacious.

However, if you want a Perl clue on how to do it, see renegadex's reply
at the bottom of
 http://perlmonks.org?node_id=530061

the basics is to get the current style of the window, and reset the bg_pixmap

  my $back_pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($image); 
  my  ($pixmap,$mask) = $back_pixbuf->render_pixmap_and_mask(255); 
  my  $style = $window->get_style(); $style=$style->copy();                              
  $style->bg_pixmap("normal",$pixmap); $window->set_style($style);                   
    
it should be easy to convert to c.


Goodluck,
zentara

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html 


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