[gtk-list] Re: [gimp-devel]Gimp Toolkit



On Fri, May 09, 1997 at 06:44:01PM +0200, Sascha Ziemann wrote:
> Otto Hammersmith wrote:
> 
> > > 2. Is there a function similar to gtk_button_new_with_label but with
> > > pixmap images?
> > 
> > Nope.
> > 
> > If you look at the source for gtk_button_new_with_label(), you'll see
> > that all it's doing is creating a new button, then using
> > gtk_container_add() to insert a label into the button.  So, create the
> > button and pixmap, and use gtk_container_add() to put the pixmap in
> > the button.
> 
> The documentation about gtk is really poor. So hope you will not bother
> when I ask you some questions.

Nah, the documentation is great... best self-documenting code short of
literate programs I've ever seen.
 
> As yo told, I did this:
> 
>   button = gtk_button_new ();
>   bitmap = gdk_bitmap_create_from_data (NULL,
>                                         eject_bits,
>                                         eject_width, eject_height);
>   
>   pixmap = gtk_pixmap_new (bitmap, bitmap, bitmap, bitmap, bitmap);
>   
>   gtk_misc_set_alignment (GTK_MISC (pixmap), 0.5, 0.5);
> 
>   gtk_container_add (GTK_CONTAINER (button), pixmap);
>   gtk_widget_show (pixmap);
> 
> But it ends in an error:
> 
>   ** ERROR **: BadMatch (invalid parameter attributes)
>   IOT trap/Abort (core dumped)
> 
> Do you know what that means?

Check the prototype for gtk_pixmap_new.  You're passing it a bitmap
when it's expecting a pixmap.  Try using gdk_pixmap_create_from_data.

BTW, you posted this to the gimp-devel list again... you probably want
to be using the gtk-list.

-- 
					-Otto.

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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