Re: [gtk-list] Preview on SGI O2



On Wed, 15 Oct 1997, Alessandro Baldoni mat.1010 wrote:

> Dear friends,
> 	I'm currently trying to port my GIMP extension (HaruspeX) on a SGI O2
> workstation, but I'm having a lot of troubles with the previews.
> I tried to set_xshm, push_colormap effortlessy.
> If I get my previews working, my pixmaps crash. (I have to mix preview with pixmaps).
> If my pixmaps work, my previews crash.
> I receive a lot of 
> BadMatch
> and
> BadColor
> Here are a few lines from my app:
> 

[snip .. looked ok to me]

>   frame = gtk_frame_new (NULL);
>   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
>   gtk_container_border_width (GTK_CONTAINER (frame), 0);
>   style = gtk_widget_get_style (frame);
>   pix = gdk_pixmap_create_from_xpm_d (frame->window, &mask,
> 				&style->bg[GTK_STATE_NORMAL],
> 			      data);
>   pixmap = gtk_pixmap_new (pix, mask);
>   gtk_widget_show (pixmap);
>   gdk_pixmap_destroy (pix);
>   gtk_container_add (GTK_CONTAINER (frame), pixmap);

Hmm.. you should not destroy the pixmap using gdk_pixmap_destroy().  If
you take a look at the gtkpixmap code, it just assigns the pointer to the
pixmap passed in by gtk_pixmap_new() to the pixmap member of the GtkPixmap
struct, so you invalidate the pixmap by destorying it here, and then try
to use it after. 

Give it a try anyway, and see if you have any better luck ;-)

Ian




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