Re: Creating pixmaps before creating windows
- From: Owen Taylor <owt1 cornell edu>
- To: gtk-list redhat com
- Subject: Re: Creating pixmaps before creating windows
- Date: 23 Mar 1998 11:19:58 -0500
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]