Prompt the user for confirmation before removing an export format.
[ardour.git] / libs / gtkmm2ext / cairocell.cc
index f3da7e8cb352d777a97b1af0b1af50cfb0c4cc10..f20f537e1b972f2ebafadde4b55258fed6d14ef8 100644 (file)
@@ -211,7 +211,6 @@ CairoEditableText::CairoEditableText (boost::shared_ptr<CairoFontDescription> fo
        set_flags (Gtk::CAN_FOCUS);
 
        set_can_default (true);
-       set_receives_default (true);
 }
 
 CairoEditableText::~CairoEditableText ()
@@ -232,13 +231,13 @@ CairoEditableText::on_scroll_event (GdkEventScroll* ev)
 }
 
 bool
-CairoEditableText::on_focus_in_event (GdkEventFocus* ev)
+CairoEditableText::on_focus_in_event (GdkEventFocus*)
 {
        return false;
 }
 
 bool
-CairoEditableText::on_focus_out_event (GdkEventFocus* ev)
+CairoEditableText::on_focus_out_event (GdkEventFocus*)
 {
        if (editing_cell) {
                queue_draw_cell (editing_cell);
@@ -287,7 +286,14 @@ CairoEditableText::set_text (CairoTextCell* cell, const string& text)
 bool
 CairoEditableText::on_expose_event (GdkEventExpose* ev)
 {
-       Cairo::RefPtr<Cairo::Context> context = get_window()->create_cairo_context();
+       Glib::RefPtr<Gdk::Window> win = get_window ();
+
+       if (!win) {
+               std::cerr << "CET: no window to draw on\n";
+               return false;
+       }
+
+       Cairo::RefPtr<Cairo::Context> context = win->create_cairo_context();
 
        if (cells.empty()) {
                return true;