GNOME Bugzilla – Bug 331785
gtk.Notebook.get_current_page() returns incorrect page number when pages hidden
Last modified: 2006-02-20 23:14:08 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/gtk+2.0/+bug/30348 "Hi, I have found the Gtk+ Notebook widget has inconsistent behaviour when pages are hidden. gtk_notebook_get_current_page() returns the selected page starting from 0. Hidden pages are not counted. gtk_notebook_get_nth_page() takes a page number as an argument. The number is the page number as added (i.e. it includes any hidden pages). Since these behave differently gtk_notebook_get_nth_page(gtk_notebook_get_current_page()) does not return the selected page if hidden pages are present. My expected behaviour was that hidden pages are counted but not visible. This bug is always reproducible. Find attached a PyGTK and C example that shows the bug. The use case I have for this is: An application contains a notebook which has pages that are added and removed dynamically. When the application starts the notebook contains a single "splashscreen" page. When a page is added the "splashscreen" is hidden until all the dynamically added pages are removed. I am using Ubuntu Breezy (libgtk2.0-0 version 2.8.6-0ubuntu2.1) http://librarian.launchpad.net/1546945/gtk_notebook_bug.py Python example of Gtk+ notebook hidden page bug http://librarian.launchpad.net/1546946/gtk_notebook_bug.c C example of Gtk+ notebook hidden page bug"
2006-02-20 Matthias Clasen <mclasen@redhat.com> * gtk/gtknotebook.c: Properly update internal state when child visibility changes. (#331785, Sebastien Bacher)