[91] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: Button with Image for Toolbar
daemon@ATHENA.MIT.EDU (Peter Mattis)
Mon May 12 02:10:29 1997
To: gtk-list@redhat.com
In-reply-to: Your message of "Sat, 10 May 1997 22:05:02 +0200."
<3374D4EE.5FBF597B@aibon.ping.de>
Date: Sun, 11 May 1997 23:03:02 -0700
From: Peter Mattis <petm@scam.XCF.Berkeley.EDU>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
Sascha Ziemann writes:
>But this produces a core:
>
> 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);
>/* pixmap = gtk_label_new("Tach");*/
> gtk_widget_show(pixmap);
> gtk_container_add (GTK_CONTAINER (button), pixmap);
> gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 5);
> gtk_widget_show (button);
Um, did the above segfault for you, or give a BadMatch error? It
shouldn't segfault, it should give a BadMatch error because the source
and destination depths of the drawables differ. (Bitmap = 1 bit,
Window = 8 or 15 or 16 or 24 bit). At least, that's what I think the
problem with the above code is from my little tests. If you use
"gdk_pixmap_create_from_data" instead it works. Just like using
"gdk_pixmap_create_from_xpm" worked for you.
Peter
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null