[gtk-list] Button with Image for Toolbar



Otto Hammersmith wrote:

> >   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.

GdkPixmap *
gdk_bitmap_create_from_data (GdkWindow *window,
			     gchar     *data,
			     gint       width,
			     gint       height)
GtkWidget*
gtk_pixmap_new (GdkPixmap *normal,
		GdkPixmap *active,
		GdkPixmap *prelight,
		GdkPixmap *selected,
		GdkPixmap *insensitive)

gdk_bitmap_create_from_data returns a GdkPixmap type and gtk_pixmap_new
wants such a type. I can not see any type conflict.

-- bis später...
 - Sascha         ---<~>=( http://www.ping.de/sites/aibon/ )=<~>---

   () Free speech online
   /\ http://www.eff.org/BlueRibbon/bluehtml.html

--
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]