# HG changeset patch # User hegyi # Date 1134051368 0 # Node ID 23f0afd1a323668163ec897e16591508a6e24edc # Parent e664d8aa3f721fa02dae655f441296addba760f3 Notebook tabs can be closed. diff -r e664d8aa3f72 -r 23f0afd1a323 main_win.cc --- a/main_win.cc Tue Dec 06 10:53:38 2005 +0000 +++ b/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