Bug in notebook or what am I doing wrong?




  Hello folks,

I'm developing an application, and everything went just fine until I
started to use notebook.

My main window is a vertical box, which has a combobox and an area with
several pages. The combo box is for switching between the pages.

The most of the pages created like:
   page=gtk_vbox_new(FALSE, 0);
   gtk_widget_ref(page);
   gtk_widget_show(page);

In a combo box's signal I use
  gtk_container_remove
  gtk_box_pack_start
to switch between the pages.

Now I wanted to insert a new page with a notebook, and thing became
quite mysterious.

I create the page (fs_win) with the next function:

  GtkWidget *tenyek_lab, *joestet_lab;
  GtkWidget *tenyek_win, *joestet_win;
  GtkWidget *note_win;
  GtkWidget *test_lab; 
  
  fs_win=gtk_notebook_new();
  gtk_widget_ref(fs_win);
  gtk_widget_show(fs_win);

  tenyek_lab=gtk_label_new("Tenyek");
  gtk_widget_ref(tenyek_lab);
  gtk_widget_show(tenyek_lab); 

  joestet_lab=gtk_label_new("Jo estet Mo.");
  gtk_widget_ref(joestet_lab);
  gtk_widget_show(joestet_lab);

  tenyek_win=fs_create_page(TENYEK_FRAMES_NO, tenyek_frames, TENYEK_ROWS);
  joestet_win=fs_create_page(JOESTET_FRAMES_NO, joestet_frames, JOESTET_ROWS);

  gtk_notebook_append_page(GTK_NOTEBOOK(note_win), tenyek_win, tenyek_lab);
  gtk_notebook_append_page(GTK_NOTEBOOK(note_win), joestet_win, joestet_lab);


If I start my app with this page everything looks OK.
But if I switch to another page and back the label from notebook
disappears (I added the gtk_widget_ref for the labels, but it's not
helping), and sometimes the scrollbars also disappears from the appended
page.
If starting with another page and then switch to it I receive a

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

message under linux, there's no message on Irix 6.3 (both with gtk+-1.2).
Another mysterious thing is that the notebook sometimes placed
out of my window window!

I also tried rewriting it with hbox and the only child the result is
the same. But if I add a new label to the hbox it segfaults on linux
and the label not shown on O2!

Any idea?

Tamas Krisztian 




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