Re: [gtk-list] creating pixmaps



Adrian Feiguin wrote:
> 
> This is maybe a silly question. I want to use gdk_pixmap_create_from_xpm
> (something like that) and the first arg es a window. I use to put
> widget->window. Suppouse that I
> don't have any window on the screen, I mean I haven't realized any widget:
> how can I override the consequent error/warnings?
Why ?

> Is there an alternative
> way?
Yes.
> TNX!
Isn't that in the FAQ ?
Surprise, surprise.
I suggest using the same function but with "colormap" included in the
name.
Get the system default colormap first and use that as the parameter.
In short:

    GdkColormap *default_colormap;
...
    pixmap = gdk_pixmap_colormap_create_from_xpm_d
                (NULL, default_colormap, &mask, NULL, (gchar **)
xpm_data);
    pixmapwid = gtk_pixmap_new (pixmap, mask);

Works for me.

HTH,

Norbert.

-- 
Norbert Bladt		 Payphone Management System Software Development
ascom Autelca AG
Worbstrasse 201		 CH-3073 Guemligen, Switzerland
abladtn@autelca.ascom.ch VOICE: +41 31 999 6552, FAX: +41 31 999 6575



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