Re: Creating pixmaps before creating windows




Deon Ramsey <ramsey@dfki.uni-kl.de> writes:

> hideki70@osk2.3web.ne.jp (Hideki Fujimoto) wrote:
> 
> > From: "David M. Cook" <davecook@hotmail.com>
> > Subject: [gtk-list] 
> > Date: Sat, 21 Mar 1998 05:08:36 PST
> > 
> > davecook> How do I add a pixmap to a window (a dialog in this case) 
> > davecook> before I've shown the window.  
> > 
> >  
> > 
> >  GdkColormap *cmap;
> > 
> >  cmap = gdk_colormap_get_system();
> > 
> >  <snip>
> > 
> >  xpm = gdk_pixmap_colormap_create_from_xpm_d (NULL, cmap, &mask, 
> >                                               &style->bg[GTK_STATE_NORMAL],
> >                                               XPM_DATA);
> 
> Just hope *that* is in fact the gdk colormap that this window is going to be shown with ;-)
> Another approach (swiped from testgtk.c :-) is to:

[...]

Or you could use :

 cmap = gdk_widget_get_colormap (widget);

 xpm = gdk_pixmap_colormap_create_from_xpm_d (NULL, cmap, ...);

Which is valid any time a widget is initially created, and may
be slightly more efficient than force-realizing the widget.

Regards,
                                        Owen



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