Re: [gtk-list] gtknotebook issue




This is fixed in GTK+-1.2.7.

Regards,
                                        Owen

Jamie Guinan <guinan@bluebutton.com> writes:

> Hi,
> 
> I have a little test program with a notebook as the
> main app contents, and each page I add is a Vbox
> containing a ("sub") notebook.
> 
>   --Notebook----------------------------
>  |  --Vbox----------    --Vbox----------
>  | |  --Notebook--  |  |  --Notebook--  |
>  | | |            | |  | |            | |
> 
> 
> I found that when I do the following in a menu callback,
> 
>   w = gtk_vbox_new(TRUE, 0);
>   setup(w);        /* Insert a notebook inside the vbox */
>   gtk_widget_show(w);
>   label = gtk_label_new (_("Untitled"));
>   gtk_notebook_append_page(GTK_NOTEBOOK(notebook), w, label);
>   gtk_notebook_set_page(GTK_NOTEBOOK(notebook), -1);
> 
> That last call triggers an assertion,
> 
>   Gtk-CRITICAL **: file gtkwidget.c: line 1584 (gtk_widget_map): assertion
>   `GTK_WIDGET_VISIBLE (widget) == TRUE' failed.
> 
> for every page added after the first one.  The widget that Gtk
> is complaining about is the label on the "inner" notebook page.
> 
> With GDB I tracked down the call to gtk_widget_map() to
> gtknotebook.c,
> 
>  static void
>  gtk_notebook_map (GtkWidget *widget)
>      ...
> 	  if (page->tab_label && 
> 	      GTK_WIDGET_VISIBLE (page->child) && 
> 	      !GTK_WIDGET_MAPPED (page->tab_label))
> 	    gtk_widget_map (page->tab_label);
> 
> I don't pretend to understand all the logic going on, but can
> anyone explain why it checks "GTK_WIDGET_VISIBLE (page->child)" 
> when dealing with "page->tab_label"? 
> 
> Replacing it with "GTK_WIDGET_VISIBLE (page->tab_label)"
> makes the assertion go away, but I don't know if this 
> is a bad thing to do.
> 
> Any advice?
> 
> $ gtk-config --version
> 1.2.6



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