Re: [gtkmm] Notebook trouble



Hi

Actually, you even don't have to remove page from notebook - hiding page widget is enough.
I suggest you follow this algorithm:
1. Create Notebook.
2. Append page.
3. Set page widget.
4. Set page tab.
5. Connect to signal_clicked() for your button on that page tab callback with extra parameter binded - page widget

<button>.signal_clicked ().connect (SigC::bind (SigC::slot (*this, &Class::callback), <widget>_ptr));
...
   Class::callback (Gtk::Widget* widget)
   {
       widget->hide ();
/*
If you really need to remove page, you could get it's number by (*widget) then remove from notebook
*/
   }

Regards,
-andrew

Daniel Pixley wrote:

I can't see how this closes a tab other than the current one.  Say a
user has 5 tabs open, and the 5th tab is the current tab.  If the user
clicks the close button on say the 2nd tab without bringing that tab to
focus, will the second page be removed, or will the current (5th page)
page be removed?  I don't understand how this would not just close the
current page.

Thanks for the response and the header file,
Dan





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