[gtk-list] Re: Button with Image for Toolbar

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. 


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]