Re: [gtk-list] Re: pixmaps/windows.



Joshua Richardson wrote:
> 
> > I'm in a slight catch 22. I want to have a pixmap, but I don't want to
> > show the window until the pixmap is added to it. So at runtime, it
> > complains "creating pixmap from xpm with null window and colormap".
> > (I'm guessing because the window is not shown...)
> >
> > How do I solve this?
> >
> gtk_widget_realize()?
> 
> ----------------------------------------------------------------
>                        Joshua Richardson
> Dept. Cognitive and Neural Systems / Center for Adaptive Systems
>                        Boston University
> ----------------------------------------------------------------
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

You can realize the widget or use a window that it's realized, for example:

/* in anywhere of code */
GdkWindow	*rootw;

	rootw = gdk_window_foreign_new(GDK_ROOT_WINDOW());

	pdata = gdk_pixmap_create_from_xpm(rootw, &mask, &style->bg[GTK_STATE_NORMAL],
			"PixmapIWantToShow.xpm");
	gtk_widget_show(pixm1 = gtk_pixmap_new(pdata, mask));
	gtk_fixed_put(GTK_FIXED(area), pixm1, 10, 10);
/* */



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