Re: Gtk Container add



On Tue, 2002-07-16 at 18:42, Pablo Fischer wrote:
Im creating an app with 3 buttons.. and each button will show something.
Each button have a pixmap (created it with gimp) and I have a window
(with TOP_LEVEL), also I add a box to this window (with a
gtk_container_add). The problem starts when I add the image to the
button:

  image = gtk_pixmap_new(pixmap, mask);
  gtk_widget_show (image);
  gtk_container_add(GTK_CONTAINER (button), image);

When I create a second gtk_Container_add, I get this:

Gtk-CRITICAL **: file gtkbin.c: line 217 (gtk_bin_add): assertion
`bin->child == NULL' failed.

How could I solve this?.. killing the other container, or what?.

Each button can only have one child, so it is complaining because you're
trying to add two images to the same button. Try either re-assigning the
button pointer to the second button or using a different variable name
for each of the three... (If you want multiple images inside the button,
you need to create an hbox and pack the images in there.)

Peace,

    Jim Cape
    http://ignore-your.tv/

    "No cause, no God, no abstract idea can justify the mass
     slaughter of innocents."
        -- Edward Said

Attachment: signature.asc
Description: This is a digitally signed message part



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