Re: Image Drawing : Assertion failure



hi,

your question is, in absolute terms, impossible to answer:  you haven't included all of your code (what are the types for the variables pixmap and mask?), nor have you provided the exact error message ouput (which argument is failing gtk's assertion attempt?).

but briefly,

1) gdk_pixmap_create_from_xpm() requires a filename containing xpm data.  the file you have provided is .png format, not the same.
2) gtk_pixmap_new() is deprecated, rewrite your code using the proper gdk equivalent.

and generally: at the very least, make all arguments you provide to routines match exactly the types required for each routine (as defined in the documentation), this will get you a long way towards solving your problems.

cheers,

richard

 
On Jan 3, 2007, at 11:53 AM, <richa soc-soft com> <richa soc-soft com> wrote:

I want to display an image on fixed container.

 

I have tried this with two ways :-

 

1st method:-

 

image1 = create_pixmap (window1, "babytux.png");

 
 

2nd Method:-

 

style = gtk_widget_get_style( window1 );

pixmap = gdk_pixmap_create_from_xpm( window1->window, &mask, &style->bg[GTK_STATE_NORMAL], " babytux.png ");

image1 = gtk_pixmap_new( pixmap, mask );

 

By first method it display the image correctly but in the second method for both api calls gdk_pixmap_create_from_xpm and gtk_pixmap_new it is giving assertion failed .

 

Since I want the value of mask I am using using 2nd method.

 

If anyone could tell me what could be the possible reason for this assertion failure.

 

Regards,

 

Richa

_______________________________________________
gtk-list mailing list



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