[Bug 30348] gtk.Notebook.get_current_page() returns incorrect page number when pages hidden

Robert Ancell robert.ancell at gmail.com
Thu Feb 2 22:07:24 UTC 2006


Public bug reported:
https://launchpad.net/malone/bugs/30348

Affects: gtk+2.0 libgtk2.0-0 (Ubuntu)
       Severity: Normal
       Priority: (none set)
         Status: Unconfirmed

Description:
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)




More information about the desktop-bugs mailing list