Fix midi region split, trim and move operations.
[ardour.git] / libs / canvas / widget.cc
index 9206213dbda5f7d1437d8b01fe5edf2967580abc..25541c1660abf8bbe349925e36a35130394d91c1 100644 (file)
 using namespace std;
 using namespace ArdourCanvas;
 
-Widget::Widget (Group* parent, CairoWidget& w)
+Widget::Widget (Canvas* c, CairoWidget& w)
+       : Item (c)
+       , _widget (w)
+{
+       Event.connect (sigc::mem_fun (*this, &Widget::event_proxy));
+}
+
+Widget::Widget (Item* parent, CairoWidget& w)
        : Item (parent)
        , _widget (w)
 {
@@ -39,6 +46,7 @@ Widget::Widget (Group* parent, CairoWidget& w)
 bool
 Widget::event_proxy (GdkEvent* ev)
 {
+       /* XXX need to translate coordinate into widget's own coordinate space */
        return _widget.event (ev);
 }
 
@@ -83,7 +91,7 @@ Widget::compute_bounding_box () const
 {
        std::cerr << "cbbox for widget\n";
 
-       GtkRequisition req;
+       GtkRequisition req = { 0, 0 };
        Gtk::Allocation alloc;
 
        _widget.size_request (req);