# HG changeset patch # User hegyi # Date 1134051368 0 # Node ID 3f0558065bcddedaaf9c1849d845745c613e2a48 # Parent c72636dcf0bd96d5733b8f6dcd57eb079d41f99d Notebook tabs can be closed. diff -r c72636dcf0bd -r 3f0558065bcd gui/main_win.cc --- a/gui/main_win.cc Wed Dec 07 15:43:44 2005 +0000 +++ b/gui/main_win.cc Thu Dec 08 14:16:08 2005 +0000 @@ -74,6 +74,8 @@ ag->add( Gtk::Action::create("FileMenu", "_File") ); ag->add( Gtk::Action::create("FileNewTab", "New _Tab"), sigc::mem_fun(*this, &MainWin::newTab)); + ag->add( Gtk::Action::create("FileCloseTab", "_Close Tab"), + sigc::mem_fun(*this, &MainWin::closeTab)); ag->add( Gtk::Action::create("FileNew", Gtk::Stock::NEW), sigc::mem_fun(*this, &MainWin::newFile)); ag->add( Gtk::Action::create("FileOpen", Gtk::Stock::OPEN), @@ -131,6 +133,7 @@ " " " " " " + " " " " " " " " @@ -230,6 +233,46 @@ set_tabtitle(tabnames[active_tab]); } +void MainWin::closeTab() +{ + if(active_tab!=-1) + { + //tabs vector will be decreased with the deleted value + int size=tabs.size(); + if(size>1) + { + for(int i=active_tab+1;i