Using the same pixmap in multiple windows




Here's another problem that's puzzled me for ages:

If I have a pixmap, can I display it in multiple windows, and how?
Or do I have to recreate it for each one?

The problem occurs in Glade due to the pixmaps used to represent
placeholders (empty places) which are used all over the Glade
interface. When I first released Glade several people reported
that it didn't work on multiple-depth displays.

Currently I do this for every widget that needs the pixmap:

  placeholder_pixmap
    = gdk_pixmap_create_from_xpm_d (placeholder->window, NULL,
				    &placeholder->style->bg[GTK_STATE_NORMAL],
				    placeholder_xpm);

But that seems rather wasteful.

If I make sure that every window is created with the same visual
and colormap, can I use the pixmap everywhere then?
How do I do this?


Damon




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