Index: gui/graph_displayer_canvas-event.cc
===================================================================
--- gui/graph_displayer_canvas-event.cc	(revision 1510)
+++ gui/graph_displayer_canvas-event.cc	(revision 1512)
@@ -100,5 +100,7 @@
         double dy=e->motion.y-clicked_y;
 
+	//repositioning node and its text
         active_item->move(dx, dy);
+	nodetextmap[active_node]->move(dx, dy);
 
         clicked_x=e->motion.x;
@@ -130,4 +132,5 @@
 	      }
 
+	    //reposition of edgetext
 	    xy<double> text_pos=edgesmap[ei]->get_arrow_pos();
 	    text_pos+=(xy<double>(10,10));
@@ -190,4 +193,10 @@
       *(nodesmap[active_node]) << Gnome::Canvas::Properties::outline_color("black");
       (nodesmap[active_node])->show();
+
+      nodetextmap[active_node]=new Gnome::Canvas::Text(displayed_graph, clicked_x+node_property_defaults[N_RADIUS]+5, clicked_y+node_property_defaults[N_RADIUS]+5, "");
+      nodetextmap[active_node]->property_fill_color().set_value("darkblue");
+
+      mapwin->update_node(active_node);
+
       break;
 
@@ -273,37 +282,48 @@
 	      if(target_node!=INVALID)
 		{
-		  *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red");
-
-		  //creating new edge
-		  active_edge=EdgeIt(g,g.addEdge(active_node, target_node));
-
-		  //initiating values corresponding to new edge in maps
-		  mapstorage.init_maps_for_edge(active_edge);
+		  if(target_node!=active_node)		
+		    {
+		      *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red");
+
+		      //creating new edge
+		      active_edge=EdgeIt(g,g.addEdge(active_node, target_node));
+
+		      //initiating values corresponding to new edge in maps
+		      mapstorage.init_maps_for_edge(active_edge);
 	  
-		  //calculating coordinates of new edge
-		  Gnome::Canvas::Points coos;
-		  double x1, x2, y1, y2;
+		      //calculating coordinates of new edge
+		      Gnome::Canvas::Points coos;
+		      double x1, x2, y1, y2;
 	  
-		  active_item->get_bounds(x1, y1, x2, y2);
-		  coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
-
-		  target_item->get_bounds(x1, y1, x2, y2);
-		  coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
-
-		  //drawing new edge
-		  edgesmap[active_edge]=new BrokenEdge(displayed_graph, coos, *this);
-		  *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("green");
-		  edgesmap[active_edge]->property_width_pixels().set_value(10);
-
-		  //redraw nodes to blank terminations of the new edge
-		  target_item->raise_to_top();
-		  active_item->raise_to_top();
-
-		  //initializing edge-text as well, to empty string
-		  xy<double> text_pos=edgesmap[active_edge]->get_arrow_pos();
-		  text_pos+=(xy<double>(10,10));
-
-		  edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
-		  edgetextmap[active_edge]->property_fill_color().set_value("black");
+		      active_item->get_bounds(x1, y1, x2, y2);
+		      coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+		      target_item->get_bounds(x1, y1, x2, y2);
+		      coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+		      //drawing new edge
+		      edgesmap[active_edge]=new BrokenEdge(displayed_graph, coos, *this);
+		      *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("green");
+		      edgesmap[active_edge]->property_width_pixels().set_value(10);
+
+		      //redraw nodes to blank terminations of the new edge
+		      target_item->raise_to_top();
+		      active_item->raise_to_top();
+
+		      //initializing edge-text as well, to empty string
+		      xy<double> text_pos=edgesmap[active_edge]->get_arrow_pos();
+		      text_pos+=(xy<double>(10,10));
+
+		      edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
+		      edgetextmap[active_edge]->property_fill_color().set_value("darkgreen");
+
+		      //updating its properties
+		      mapwin->update_edge(active_edge);
+		    }
+		  else
+		    {
+		      target_node=INVALID;
+		      std::cout << "Loop edge is not yet implemented!" << std::endl;
+		    }
 		}
 	      //clicked item was not a node. it could be an e.g. edge. we do not deal with it furthermore.
@@ -436,4 +456,5 @@
 void GraphDisplayerCanvas::delete_item(NodeIt node_to_delete)
 {
+  delete(nodetextmap[node_to_delete]);
   delete(nodesmap[node_to_delete]);
   g.erase(node_to_delete);
@@ -442,4 +463,5 @@
 void GraphDisplayerCanvas::delete_item(EdgeIt edge_to_delete)
 {
+  delete(edgetextmap[edge_to_delete]);
   delete(edgesmap[edge_to_delete]);
   g.erase(edge_to_delete);
@@ -448,4 +470,5 @@
 void GraphDisplayerCanvas::delete_item(Graph::Edge edge_to_delete)
 {
+  delete(edgetextmap[edge_to_delete]);
   delete(edgesmap[edge_to_delete]);
   g.erase(edge_to_delete);
