+void
+GtkCanvas::on_map ()
+{
+ Gtk::EventBox::on_map();
+#ifdef __APPLE__
+ if (_nsglview) {
+ Gtkmm2ext::nsglview_set_visible (_nsglview, true);
+ Gtk::Allocation a = get_allocation();
+ gint xx, yy;
+ gtk_widget_translate_coordinates(
+ GTK_WIDGET(gobj()),
+ GTK_WIDGET(get_toplevel()->gobj()),
+ 0, 0, &xx, &yy);
+ Gtkmm2ext::nsglview_resize (_nsglview, xx, yy, a.get_width(), a.get_height());
+ }
+#endif
+}
+
+void
+GtkCanvas::on_unmap ()
+{
+ stop_tooltip_timeout ();
+ Gtk::EventBox::on_unmap();
+#ifdef __APPLE__
+ if (_nsglview) {
+ Gtkmm2ext::nsglview_set_visible (_nsglview, false);
+ }
+#endif
+}
+
+void
+GtkCanvas::queue_draw()
+{
+#ifdef __APPLE__
+ if (_nsglview) {
+ Gtkmm2ext::nsglview_queue_draw (_nsglview, 0, 0, get_width (), get_height ());
+ return;
+ }
+#endif
+ Gtk::Widget::queue_draw ();
+}
+
+void
+GtkCanvas::queue_draw_area (int x, int y, int width, int height)
+{
+#ifdef __APPLE__
+ if (_nsglview) {
+ Gtkmm2ext::nsglview_queue_draw (_nsglview, x, y, width, height);
+ return;
+ }
+#endif
+ Gtk::Widget::queue_draw_area (x, y, width, height);
+}
+