notebook -> set_current_page has no effect at all

I have a very basic window composed by a Notebook widget that has 3 tabs (3 togglebuttons)
I try to use the set_current_page function to activate the third tab but it has simply no effect at all. It just shows the window with the first tab activated.
Can anyone tell me what is wrong?? (I don't think it is a refresh problem as i could read in some related posts)

Thanks for your precious help!


--------------------------------Sample of the code:--------------------------------------------------
(My window subclass Gtk::Window and contains members that are pointers to the notebook and the togglebuttons)

 : r_notebook(new Gtk::Notebook()),
   r_toggleButton1(new Gtk::ToggleButton("--1--")),
   r_toggleButton2(new Gtk::ToggleButton("--2--")),
   r_toggleButton3(new Gtk::ToggleButton("--3--"))
   int index1 = r_notebook->append_page(*r_toggleButton1, "Toggle 1");
   int index2 = r_notebook->append_page(*r_toggleButton2, "Toggle 2");
   int index3 = r_notebook->append_page(*r_toggleButton3, "Toggle 3");

   add(*r_notebook);       // add Notebook to the top level window

   int index = r_notebook->page_num(*r_toggleButton3);   // get index of third tab
   if (index > 0)
      r_notebook->set_current_page(index);      // pass here but does nothing at all
      std::cout<<"TAB " << index << " FOUND!!\n";
   r_notebook->set_current_page(index3);   // another attempt ---> no effect at all neither!!

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