Re: Window shape and back_pixmap



Greg Breland ha scritto lo scorso 18/02/2005 16.40:
The expose event wouldn't work for me either unless, as you did, I
returned TRUE.  I even tried calling _after all the other expose events
with no luck.  I ended up having to set the background pixmap on "show"
of the window.  I have no way of knowing if it will work on Windows
though.

On Fri, 2005-02-18 at 05:32, Carlo wrote:

In order to see what were happening, I tried to hook the window expose event:

gboolean on_winmain_expose_event (GtkWidget *      widget,
                                  GdkEventExpose * event,
                                  gpointer         user_data)
  return TRUE;
         ^^^^
}





Hmm, my original post was:

gboolean on_winmain_expose_event (GtkWidget *      widget,
                                  GdkEventExpose * event,
                                  gpointer         user_data)
{
  GdkBitmap * mask;
  GdkPixmap * map;
  GdkPixbuf * pbuf;

  pbuf = gdk_pixbuf_new_from_file
                 ("/home/carlo/Projects/shape/sfondo.png", NULL);
  gdk_pixbuf_render_pixmap_and_mask (pbuf, &map, &mask, 1);
  gdk_window_shape_combine_mask (winmain->window, mask, 0, 0);
  gdk_window_set_back_pixmap (winmain->window, map, FALSE);

  return TRUE;
         ^^^^
}

Anyway, I've understood that the use of gdk_window_set_back_pixmap is
not so straightforward, because of deep interaction with the theme engine.

At this moment, I'm able to show my window with desired shape and pixmap
by hacking current gtkrc file (but not for all themes); I believe I need
some more study of RC style parsing and massaging directly through
source code.





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