Re: [gtk-list] Using the same pixmap in multiple windowsx
- From: Tim Janik <timj gtk org>
- To: Damon Chaplin <DAChaplin email msn com>
- cc: Gtk+ MList <gtk-list redhat com>
- Subject: Re: [gtk-list] Using the same pixmap in multiple windowsx
- Date: Fri, 7 Aug 1998 02:08:15 +0200 (CEST)
On Thu, 6 Aug 1998, Damon Chaplin wrote:
> 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:
> = gdk_pixmap_create_from_xpm_d (placeholder->window, NULL,
> 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?
i had the same problem with the GLE palette, since i temporarily need
new pixmaps for dragging them (thanx for your pixmaps btw, it's much nicer
to click on those than to select them from a popup).
so in order to get the same visual and colormap for the drag window, i roughly
gtk_widget_push_colormap (gtk_widget_get_colormap (GTK_WIDGET (wpalette)));
gtk_widget_push_visual (gtk_widget_get_visual (GTK_WIDGET (wpalette)));
gtk_widget_new (GTK_TYPE_WINDOW, ...);
/* add the containers and then the pixmaps */
the newly added containers and their children will automatically be realized
as well (with the same visual and colormap), because the toplevel is already
you can glance at the exact code portions in the CVS module "gle" in
] [Thread Prev