Re: Page numbers in GtkNotebook



Dear Audrey,

Then you can get the notebook label or the widget name or something else to
uniquely identify which tab is actually open.

I'm not sure if this is ideal, but it worked for me.

It works for me too!

Also, while working on your solution I found that
if I use 
    g_signal_connect_after(...switch_page...)
instead of
    g_signal_connect(...switch_page...)
then in the callback for switch_page I can do:

on_nb1_main_options_switch_page (GtkNotebook     *notebook,
                                 GtkNotebookPage *page,
                                 guint            page_num,
                                 gpointer         user_data)
{
    switch (page_num) {
        case 0:
            break;
        case 1:
            break;
            ...
    }
}


where page_num is the correct ascending ordered page 
number I want!


For example, if my notebook looks like this:
    +---+---+---+---+--------------------------
    | A | B | C | D | ....
    +---+---+---+---+--------------------------

then page_num will be 0 for A, 1 for B, 2 for C and so on...!


Thank you so much.

Regards,
Manu

The art of living is to gain this ability in life -
it's very simple, just a skill - the ability to free
your mind of the past, to free your mind of the future
fears, and to be able to play with every situation that
is in front of you, to be able to take every situation
that is in front of you.
- Sri Sri RaviShankar
http://www.artofliving.org








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