- if (_text) {
- delete _text;
- _text = 0;
- }
-
- _text = new Text(*this, 0.0, 0.0, a_text);
+ /* XXX this connection is needed if ::on_event() is changed to actually do anything */
+ signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
+}
+
+void
+CanvasFlag::delete_allocated_objects()
+{
+ delete _text;
+ _text = 0;
+
+ delete _line;
+ _line = 0;
+
+ delete _rect;
+ _rect = 0;
+}
+
+void
+CanvasFlag::set_text(const string& a_text)
+{
+ delete_allocated_objects();
+
+ _text = new Text (*this, 0.0, 0.0, std::string(a_text));