Gtk-CRITICAL **: file gtkwidget.c: line 3359 (gtk_widget_set_parent): assertion `widget->parent == NULL' failed.



Hi,
I am a pretty newbie in Gtk.

I have errors,
"Gtk-CRITICAL **: file gtkwidget.c: line 3359 (gtk_widget_set_parent):
assertion `widget->parent == NULL' failed."

It is issued from "gtk_fixed_put (GTK_FIXED(fixed), RxCam[num].button,
160*i, 120*j);" in the "for" loop.

I tried to set parent the widget of fixed widget but I could not solve
the error.

What is wrong in the below gtk_fixed_put () usage?

Regards,
bkna.


GtkWidget *makeFixedContainer(GtkWidget *window) {
  int i, j, num;
  GtkWidget *table;
  GtkWidget *fixed;

  fixed = gtk_fixed_new ();
  gtk_widget_show (fixed);

  table = gtk_table_new(2, 2, FALSE);
  gtk_box_pack_start (GTK_BOX(window), table, FALSE, TRUE, 0);

  for(j = 0; j < 2; j++) {
    for(i = 0; i < 2; i++) {
      num = i + 2 * j;
      R[num].myid = num;
      R[num].button = gtk_button_new();
      R[num].fixed = fixed;

      gtk_table_attach_defaults (GTK_TABLE(table), R[num].button, i, i +
1, j, j + 1);

      R[num].darea = gtk_drawing_area_new ();
      gtk_drawing_area_size (GTK_DRAWING_AREA(R[num].darea), 100, 100);
      gtk_container_add (GTK_CONTAINER(R[num].button), R[num].darea);
      gtk_widget_realize (R[num].darea);

      gtk_signal_connect (GTK_OBJECT(R[num].button), "clicked",
                                             GTK_SIGNAL_FUNC(resize),
&RxCam[num]);

      gtk_fixed_put (GTK_FIXED(fixed), R[num].button, 100*i, 100*j);
    }
  }

  gtk_container_add (GTK_CONTAINER (window), fixed);

  return table;
}

begin:vcard 
n:Na, PhD;Bokyun
tel;cell:+82-11-9944-2946
tel;work:+82-2-324-0908
x-mozilla-html:FALSE
url:http://www.besta.cc
org:Besta networks Co.
adr:;;;;;;
version:2.1
email;internet:bkna besta cc
title:CEO
x-mozilla-cpt:;0
fn:Bokyun Na, PhD
end:vcard


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