After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 73229 - No pleasant way to get a count of pages in the notebook
No pleasant way to get a count of pages in the notebook
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-03-02 22:08 UTC by Havoc Pennington
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2002-03-02 22:08:57 UTC
There should be a gtk_notebook_get_n_pages() function.

(My use-case is wanting to set the "next tab" menu item insensitive if 
the current page is the last page.)
Comment 1 Havoc Pennington 2002-03-02 22:14:10 UTC
You should be able to do this:

  gtk_notebook_page_num (GTK_NOTEBOOK (notebook),
                           gtk_notebook_get_nth_page (GTK_NOTEBOOK
(notebook),
                                                      -1));
  
But get_nth_page doesn't accept -1 to mean the last page.
Comment 2 Owen Taylor 2002-09-23 22:07:26 UTC
Mon Sep 23 18:01:52 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtknotebook.[ch]: Add gtk_notebook_get_n_pages
        (#73229, Havoc Pennington)

        * gtk/gtknotebook.c (gtk_notebook_get_nth_page): Handle
        -1 to mean the last page, as we do elsewhere. (#73229)