Index: algobox.cc
===================================================================
--- algobox.cc	(revision 108)
+++ algobox.cc	(revision 109)
@@ -60,7 +60,7 @@
 }
 
-void AlgoBox::update_maplist( void * ms)
+void AlgoBox::update_maplist(MapStorage * ms)
 {
-  mapstorage=(MapStorage *)ms;
+  mapstorage=ms;
   std::vector<std::string> nml;
   std::vector<std::string> eml;
@@ -70,5 +70,5 @@
       mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::edgemaplist_changed));
       nml=mapstorage->getNodeMapList();
-      eml=mapstorage->getNodeMapList();
+      eml=mapstorage->getEdgeMapList();
     }
   for(int i=0;i<(int)nodemapcbts.size();i++)
Index: algobox.h
===================================================================
--- algobox.h	(revision 108)
+++ algobox.h	(revision 109)
@@ -34,5 +34,5 @@
 
   void update_tablist( std::vector< std::string > tl );
-  void update_maplist( void * );
+  void update_maplist( MapStorage * );
 
   void nodemaplist_changed(std::string);
Index: algowin.cc
===================================================================
--- algowin.cc	(revision 108)
+++ algowin.cc	(revision 109)
@@ -72,5 +72,5 @@
 }
 
-void AlgoWin::update_maplist(void * mapstorage)
+void AlgoWin::update_maplist(MapStorage * mapstorage)
 {
   ab->update_maplist(mapstorage);
Index: algowin.h
===================================================================
--- algowin.h	(revision 108)
+++ algowin.h	(revision 109)
@@ -7,7 +7,10 @@
 
 #include <all_include.h>
+//#include <mapstorage.h>
 #include <algobox.h>
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
+
+class MapStorage;
 
 enum {GENERAL, KRUSKAL, ALGO_NUM}; // algorithm IDs;
@@ -35,5 +38,5 @@
 
   void update_tablist(std::vector<std::string> tabnames);
-  void update_maplist( void *);
+  void update_maplist(MapStorage *);
 
   void on_hide();
Index: graph_displayer_canvas-event.cc
===================================================================
--- graph_displayer_canvas-event.cc	(revision 98)
+++ graph_displayer_canvas-event.cc	(revision 109)
@@ -851,48 +851,3 @@
 	}
     }
-
-}
-
-int GraphDisplayerCanvas::addNewEdgeMap(double default_value, std::string mapname)
-{
-  //create the new map
-  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> ((mytab.mapstorage).graph, default_value);
-
-  //if addition was not successful addEdgeMap returns one.
-  //cause can be that there is already a map named like the new one
-  if((mytab.mapstorage).addEdgeMap(mapname,emptr, default_value))
-    {
-      return 1;
-    }
-
-
-  //add it to the list of the displayable maps
-  mytab.registerNewEdgeMap(mapname);
-
-  //display it
-  changeEdgeText(mapname);
-
-  return 0;
-}
-
-int GraphDisplayerCanvas::addNewNodeMap(double default_value, std::string mapname)
-{
-  //create the new map
-  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> ((mytab.mapstorage).graph,default_value);
-
-  //if addition was not successful addNodeMap returns one.
-  //cause can be that there is already a map named like the new one
-  if((mytab.mapstorage).addNodeMap(mapname,emptr, default_value))
-    {
-      return 1;
-    }
-
-  //add it to the list of the displayable maps
-  mytab.registerNewNodeMap(mapname);
-
-  //display it
-  changeNodeText(mapname);
-
-  return 0;
-}
-
+}
Index: kruskalbox.cc
===================================================================
--- kruskalbox.cc	(revision 108)
+++ kruskalbox.cc	(revision 109)
@@ -1,3 +1,5 @@
 #include <kruskalbox.h>
+
+enum {INPUT, OUTPUT, MAP_NUM};
 
 KruskalBox::KruskalBox(std::vector<std::string> t):AlgoBox()
@@ -8,21 +10,55 @@
 void KruskalBox::run()
 {
-  
-  std::cout << "Kruskal inditasa, de meg nincsen keszen." << std::endl;
+  Graph g=mapstorage->graph;
+  Graph::EdgeMap<double> * inputmap=((mapstorage->edgemap_storage)[(edgemapcbts[INPUT])->get_active_text()]);
+  Graph::EdgeMap<bool> outputmap(g);
+  double res=kruskal(g, *inputmap, outputmap);
+
+  for (EdgeIt i(g); i!=INVALID; ++i)
+  {
+    if(outputmap[i])
+      {
+	(*((mapstorage->edgemap_storage)[(edgemapcbts[OUTPUT])->get_active_text()]))[i]=1;
+      }
+    else
+      {
+	(*((mapstorage->edgemap_storage)[(edgemapcbts[OUTPUT])->get_active_text()]))[i]=0;
+      }
+  }
+
+  std::ostringstream o;
+  o << "Result: " << res;
+  resultlabel.set_text(o.str());
+
+  mapstorage->changeActiveMap(true, E_COLOR, (edgemapcbts[OUTPUT])->get_active_text());
+  mapstorage->changeActiveMap(true, E_TEXT, (edgemapcbts[INPUT])->get_active_text());
 }
     
 void KruskalBox::build_box()
 {
-  edgemapcbts.resize(1);
-  Gtk::HBox * hbox=new Gtk::HBox();
+  edgemapcbts.resize(MAP_NUM);
+  Gtk::HBox * hbox;
 
-  std::ostringstream o;
-  o << "Edgecosts: ";
-  label=new Gtk::Label(o.str());
+  hbox=new Gtk::HBox();
+
+  label=new Gtk::Label("Edgecosts: ");
 
   edgemapcbts[0]=new Gtk::ComboBoxText();
 
   hbox->pack_start(*label);
-  hbox->pack_start(*(edgemapcbts[0]));
+  hbox->pack_start(*(edgemapcbts[INPUT]));
   pack_start(*hbox);
+
+  hbox=new Gtk::HBox();
+
+  label=new Gtk::Label("Edges of tree here: ");
+
+  edgemapcbts[1]=new Gtk::ComboBoxText();
+
+  hbox->pack_start(*label);
+  hbox->pack_start(*(edgemapcbts[OUTPUT]));
+  pack_start(*hbox);
+
+  resultlabel.set_text("Result: algorithm is not run yet.");
+  pack_start(resultlabel);
 }
Index: kruskalbox.h
===================================================================
--- kruskalbox.h	(revision 108)
+++ kruskalbox.h	(revision 109)
@@ -14,4 +14,6 @@
 class KruskalBox : public AlgoBox
 {
+  Gtk::Label resultlabel;
+
 public:
   KruskalBox(std::vector<std::string> t);
Index: new_map_win.cc
===================================================================
--- new_map_win.cc	(revision 108)
+++ new_map_win.cc	(revision 109)
@@ -121,4 +121,5 @@
 				}
 			      polishstack.push(atof(def_val_ch));
+			      delete def_val_ch;
 			    }
 			  operation=false;
@@ -165,4 +166,6 @@
 	      //display it
 	      //gdc.changeEdgeText(mapname);
+
+	      //delete emptr;
 	    }
 	  else //!edge.get_active()
@@ -205,4 +208,5 @@
 				}
 			      polishstack.push(atof(def_val_ch));
+			      delete def_val_ch;
 			    }
 			  operation=false;
@@ -249,4 +253,6 @@
 	      //display it
 	      //gdc.changeNodeText(mapname);
+
+	      //delete emptr;
 	    }
 	  if(!abortion)
