Re: problems to read a "from widget independent" pixmap (Resending...)
- From: Helmethead <hoshem mel comcen com au>
- To: Ignacio Nodal <inodal teleline es>
- Cc: GTK-List <gtk-list gnome org>
- Subject: Re: problems to read a "from widget independent" pixmap (Resending...)
- Date: Fri, 25 May 2001 13:15:21 +1000
On Thu, May 24, 2001 at 07:29:29PM +0100, Ignacio Nodal wrote:
> Hi,
>
> I want to write a function to read a pixmap string and store it into a
> GdkPixmap, but without having to know which widget it will be added into.By
> the way the widget could be still not created at all.
> The problem is if I use gdk_pixmap_create_from_xpm_d() one of its parameters
> force me to specify a "GdkWindow *window". I'm not using any transparent
> color, so the "style" isn't a real problem for me...
> If I use a non-existing widget I obviously get this error:
> "Gdk-WARNING **: Creating pixmap from xpm with NULL window and colormap"
>
> I haven't found a way to do this, so i'm using the program main window, but
> I'll like to store the GdkPixmap without having to know where I finally will
> attache it... Is it possible or am I just talking nonsense? ;-))
I would flame you for not reading the FAQ (http://www.gtk.org/faq/#AEN660), but I don't really like it's answer.
When you create a pixmap you are going to copy it to a GdkWindow, but to create it gdk needs to know the colormap of the window. So technically you are talking nonsense, you need to know the colormap of widget->window to create a pixmap. But practically speaking, you can use the default colormap. If a widget decides to do something really stupid like use a different colormap you're screwed though.
pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL,
gtk_widget_get_default_colormap(),
&mask, NULL, xpm_structure);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]