diff -r 48580778851e -r 4e8704aae278 graph_displayer_canvas.cc --- a/graph_displayer_canvas.cc Thu Dec 28 15:31:39 2006 +0000 +++ b/graph_displayer_canvas.cc Wed Jan 10 14:37:46 2007 +0000 @@ -25,7 +25,8 @@ nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0), isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""), edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_size(20), edge_width(10), - was_redesigned(false), is_drawn(false), mytab(mainw) + was_redesigned(false), is_drawn(false), mytab(mainw), + background_set(false) { //base event handler is move tool actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); @@ -34,6 +35,32 @@ active_node=INVALID; active_edge=INVALID; forming_edge=INVALID; + + setBackground(); +} + +void GraphDisplayerCanvas::setBackground() +{ + if (background_set) + { + delete background; + } + if (mytab.mapstorage.isBackgroundSet()) + { + background_set = true; + refBackground = Gdk::Pixbuf::create_from_file( + mytab.mapstorage.getBackgroundFilename()); + background = new Gnome::Canvas::Pixbuf( + *(root()), + 0.0 - refBackground->get_width() / 2.0, + 0.0 - refBackground->get_height() / 2.0, + refBackground); + background->lower_to_bottom(); + } + else + { + background_set = false; + } } GraphDisplayerCanvas::~GraphDisplayerCanvas()