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

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

Post by b.. » Wed, 03 Apr 2002 12:06:44



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;

Quote:}

 
 
 

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

  bkna.vcf
< 1K Download

2. Anybody running Solaris on Toshiba Tecra ?

3. 2.4.14-pre7 KERNEL: assertion (sk->pprev==NULL) failed at tcp_ipv4.c(345):__tcp_v4_hash

4. X server

5. gconfd assertion `src != NULL' failed

6. Top 10 subjects comp.unix.shell

7. HELP: 2>&1 > /dev/null != 2>&- > /dev/null ???

8. unfreed memory and exec()

9. rsh machine -n 'command >&/dev/null </dev/null &'

10. mpatrol -- Assertion failed: RW_READ_HELD(&(scn->s_elf->ed_rwlock)),

11. C programming Error : Assertion failed: table->edgeH == VL_EDGE_NO_WRITE || table->edgeH == VL_EDGE_ZERO_FILL || table ?

12. Gtk-CRITICAL

13. Qt: Problem with widget's parent