[Glade-users] Changing the image of a pixmap



On 04-Oct-2000 Damon Chaplin wrote:
The mask argument to gdk_pixmap_create_from_xpm() should be a GdkBitmap
**mask
rather than a GdkBitmap *mask. Didn't the compiler warn about this?

A typo when transposing to email.

So this may be better:

 dialog_widget = lookup_widget(Dialog,"dialog_widget")
 Image = gdk_pixmap_create_from_xpm (dialog_widget->window, &ImageMask,
                                     NULL, "error32.xpm");

 //image is the name given to the pixmap entry in glade
 gtk_pixmap_set(GTK_PIXMAP(lookup_widget(Dialog,"image")),Image,ImageMask);

This is still basically what I was doing before, just negating the multiple
calls to lookup_widget().  It's still segfaulting, here's the backtrace from
gdb:

#0  0x41f0c8 in gdk_bitmap_ref () from /usr/lib/libgdk-1.2.so.0
#1  0x3fa1f8 in GTK_TYPE_GDK_COLOR () from /usr/lib/libgtk-1.2.so.0
Cannot access memory at address 0xafc3815b

Is gdk_pixmap_create_from_xpm allocating memory for the mask, because I'm not..
 The segfault itself is occuring within the gtk_pixmap_set call.



Regards,

Chris

-----
Chris Freeze           Email: cfreeze cs clemson edu
                         Web: http://www.cs.clemson.edu/~cfreeze 





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