Index: main_win.cc
===================================================================
--- main_win.cc	(revision 94)
+++ main_win.cc	(revision 95)
@@ -2,7 +2,6 @@
 #include "icons/guipixbufs.h"
 
-MainWin::MainWin()
-{
-  mapwin=new MapWin("Map Setup", mapstorage.getEdgeMapList(), mapstorage.getNodeMapList(), *this);
+MainWin::MainWin():mapwinexists(false)
+{
   gd_canvas=new GraphDisplayerCanvas(*this);
 
@@ -106,5 +105,5 @@
   ag->add( Gtk::Action::create("ShowMenu", "_Show") );
   ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
-      sigc::mem_fun(*(this->mapwin), &MapWin::show));
+	   sigc::mem_fun(*this, &MainWin::createMapWin));
 
   Gtk::RadioAction::Group tool_group;
@@ -213,5 +212,8 @@
   mapstorage.modified = false;
   gd_canvas->drawGraph();
-  mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+  if(mapwinexists)
+    {
+      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+    }
   set_title(Glib::filename_display_basename(file) + " - " + prog_name);
 }
@@ -239,5 +241,8 @@
   gd_canvas->clear();
   mapstorage.clear();
-  mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+  if(mapwinexists)
+    {
+      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+    }
   set_title("unsaved file - " + prog_name);
 }
@@ -276,5 +281,8 @@
       mapstorage.modified = false;
       gd_canvas->drawGraph();
-      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+      if(mapwinexists)
+	{
+	  mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+	}
       set_title(Glib::filename_display_basename(filename) + " - " + prog_name);
     }
@@ -333,5 +341,8 @@
   gd_canvas->clear();
   mapstorage.clear();
-  mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+  if(mapwinexists)
+    {
+      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
+    }
   set_title("unsaved file - " + prog_name);
 }
@@ -360,9 +371,31 @@
 void MainWin::registerNewEdgeMap(std::string mapname)
 {
-  mapwin->registerNewEdgeMap(mapname);
+  if(mapwinexists)
+    {
+      mapwin->registerNewEdgeMap(mapname);
+    }
 }
 
 void MainWin::registerNewNodeMap(std::string mapname)
 {
-  mapwin->registerNewNodeMap(mapname);
-}
+  if(mapwinexists)
+    {
+      mapwin->registerNewNodeMap(mapname);
+    }
+}
+
+void MainWin::createMapWin()
+{
+  if(!mapwinexists)
+    {
+      mapwin=new MapWin("Map Setup", mapstorage.getEdgeMapList(), mapstorage.getNodeMapList(), *this);
+      mapwin->show();
+      mapwinexists=true;
+    }
+}
+
+void MainWin::closeMapWin()
+{
+  mapwinexists=false;
+  delete mapwin;
+}
Index: main_win.h
===================================================================
--- main_win.h	(revision 94)
+++ main_win.h	(revision 95)
@@ -28,6 +28,6 @@
 
 protected:
-  ///Window of map-showing setup. Its type is \ref MapWin
   MapWin * mapwin;
+  bool mapwinexists;
 
   ///The graph will be drawn on this \ref GraphDisplayerCanvas
@@ -67,4 +67,6 @@
   void registerNewNodeMap(std::string);
 
+  void createMapWin();
+  void closeMapWin();
 };
 
Index: map_win.cc
===================================================================
--- map_win.cc	(revision 94)
+++ map_win.cc	(revision 95)
@@ -6,5 +6,6 @@
   if(e->keyval==GDK_Escape)
   {
-    hide();
+    mainwin.closeMapWin();
+    //    hide();
   }
   return true;
@@ -24,5 +25,5 @@
   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
   {
-    e_combo_array[i]=new MapSelector(eml, i, true);
+    e_combo_array[i]=new MapSelector(eml, mainwin.getActiveEdgeMap(i), i, true);
 
     (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
@@ -44,5 +45,5 @@
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
   {
-    n_combo_array[i]=new MapSelector(nml, i, false);
+    n_combo_array[i]=new MapSelector(nml, mainwin.getActiveNodeMap(i), i, false);
 
     (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
@@ -60,4 +61,8 @@
   show_all_children();
 
+}
+
+MapWin::~MapWin()
+{
 }
 
@@ -107,2 +112,9 @@
   }
 }
+
+bool MapWin::on_delete_event(GdkEventAny * event)
+{
+  event=event;
+  mainwin.closeMapWin();
+  return true;
+}
Index: map_win.h
===================================================================
--- map_win.h	(revision 94)
+++ map_win.h	(revision 95)
@@ -41,5 +41,5 @@
   public:
 
-    MapSelector(std::vector<std::string>, int, bool);
+    MapSelector(std::vector<std::string>, std::string, int, bool);
 
     sigc::signal<void, std::string> signal_cbt_ch();
@@ -80,4 +80,8 @@
   MapWin(const std::string& title, std::vector<std::string>, std::vector<std::string>, MainWin & mw);
 
+  ~MapWin();
+
+  virtual bool on_delete_event(GdkEventAny *);
+
   void nodeMapChanged(std::string, int);
 
Index: mw-mapselector.cc
===================================================================
--- mw-mapselector.cc	(revision 94)
+++ mw-mapselector.cc	(revision 95)
@@ -1,9 +1,18 @@
 #include "map_win.h"
 
-MapWin::MapSelector::MapSelector(std::vector<std::string> ml, int identifier, bool edge):id(identifier),itisedge(edge),default_state(true),set_new_map(false)
+MapWin::MapSelector::MapSelector(std::vector<std::string> ml, std::string act, int identifier, bool edge):id(identifier),itisedge(edge),set_new_map(false)
 {
   update_list(ml);
 
-  cbt.set_active(0);
+  if(act=="")
+    {
+      cbt.set_active(0);
+      default_state=true;
+    }
+  else
+    {
+      cbt.set_active_text((Glib::ustring)act);
+      default_state=false;
+    }
 
   //binding signal to the actual entry
@@ -56,4 +65,5 @@
 void MapWin::MapSelector::update_list( std::vector< std::string > ml )
 {
+  int prev_act=cbt.get_active_row_number();
   cbt.clear();
   std::vector< std::string >::iterator emsi=ml.begin();
@@ -63,4 +73,8 @@
     }
   cbt.prepend_text("Default values");
+  if(prev_act!=-1)
+    {
+      cbt.set_active(prev_act);
+    }
 }
 
@@ -78,5 +92,4 @@
   else if((!default_state)&&(cbt.get_active_row_number()==0))
     {
-      signal_cbt.emit("");
       reset();
     }
@@ -86,4 +99,5 @@
 {
   default_state=true;
+
   cbt.set_active(0);
 
