Re: gtk_notebook_map bug



Owen Taylor wrote:
> 
> Damon Chaplin <damon@karuna.freeserve.co.uk> writes:
> 
> > gtk_notebook_map () doesn't check if the tab label is visible before
> > mapping it (GTK+ 1.2.6):

> Do you have an example that could be used to determine the code path
> that was causing this warning?

Here's a simple test case (though the problem was originally spotted in
Glade, which is a lot more complicated).

Damon

/*
 * Test case to reproduce a bug in GtkNotebook (GTK+ 1.2.6).
 * Compile & run and it should output:

Gtk-CRITICAL **: file gtkwidget.c: line 1584 (gtk_widget_map): assertion `GTK_WIDGET_VISIBLE (widget) == TRUE' failed.

 */


#include <stdlib.h>
#include <gtk/gtk.h>

int
main (int argc, char *argv[])
{
  GtkWidget *window, *notebook, *page, *tablabel;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  notebook = gtk_notebook_new ();
  gtk_widget_show (notebook);
  gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
  gtk_container_add (GTK_CONTAINER (window), notebook);

  page = gtk_label_new ("Page 1");
  gtk_widget_show (page);
  tablabel = gtk_label_new ("Tab 1");
  gtk_widget_show (tablabel);
  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, tablabel);

  gtk_widget_show (window);

  gtk_main ();
  return 0;
}



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