+ GtkTreePath *treepath = gtk_tree_path_new_from_string( path );
+ GtkTreeIter iter;
+ wx_renderer->GetOwner()->GetOwner()->GtkGetInternal()->get_iter( &iter, treepath );
+ wxDataViewItem item( (void*) iter.user_data );;
+ gtk_tree_path_free( treepath );
+
+ wxDataViewColumn *column = wx_renderer->GetOwner();
+ wxDataViewCtrl *dv = column->GetOwner();
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING, dv->GetId() );
+ event.SetDataViewColumn( column );
+ event.SetModel( dv->GetModel() );
+ event.SetColumn( wx_renderer->GetOwner()->GetModelColumn() );
+ event.SetItem( item );
+ dv->HandleWindowEvent( event );
+
+ if (event.IsAllowed())
+ return GTK_CELL_RENDERER_CLASS(text_cell_parent_class)->
+ start_editing( gtk_renderer, gdk_event, widget, path, background_area, cell_area, flags );
+ else
+ return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// define new GTK+ class GtkWxCellRenderer
+//-----------------------------------------------------------------------------
+
+extern "C" {
+
+#define GTK_TYPE_WX_CELL_RENDERER (gtk_wx_cell_renderer_get_type ())
+#define GTK_WX_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WX_CELL_RENDERER, GtkWxCellRenderer))
+#define GTK_WX_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WX_CELL_RENDERER, GtkWxCellRendererClass))
+#define GTK_IS_WX_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WX_CELL_RENDERER))
+#define GTK_IS_WX_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WX_CELL_RENDERER))
+#define GTK_WX_CELL_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WX_CELL_RENDERER, GtkWxCellRendererClass))
+
+GType gtk_wx_cell_renderer_get_type (void);
+
+typedef struct _GtkWxCellRenderer GtkWxCellRenderer;
+typedef struct _GtkWxCellRendererClass GtkWxCellRendererClass;
+
+struct _GtkWxCellRenderer
+{
+ GtkCellRenderer parent;
+
+ /*< private >*/
+ wxDataViewCustomRenderer *cell;
+ guint32 last_click;
+};
+
+struct _GtkWxCellRendererClass
+{
+ GtkCellRendererClass cell_parent_class;
+};
+
+
+static GtkCellRenderer *gtk_wx_cell_renderer_new (void);
+static void gtk_wx_cell_renderer_init (
+ GtkWxCellRenderer *cell );
+static void gtk_wx_cell_renderer_class_init(
+ GtkWxCellRendererClass *klass );
+static void gtk_wx_cell_renderer_finalize (
+ GObject *object );
+static void gtk_wx_cell_renderer_get_size (
+ GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *rectangle,
+ gint *x_offset,
+ gint *y_offset,
+ gint *width,
+ gint *height );
+static void gtk_wx_cell_renderer_render (
+ GtkCellRenderer *cell,
+ GdkWindow *window,
+ GtkWidget *widget,
+ GdkRectangle *background_area,
+ GdkRectangle *cell_area,
+ GdkRectangle *expose_area,
+ GtkCellRendererState flags );
+static gboolean gtk_wx_cell_renderer_activate(
+ GtkCellRenderer *cell,
+ GdkEvent *event,
+ GtkWidget *widget,
+ const gchar *path,
+ GdkRectangle *background_area,
+ GdkRectangle *cell_area,
+ GtkCellRendererState flags );
+static GtkCellEditable *gtk_wx_cell_renderer_start_editing(
+ GtkCellRenderer *cell,
+ GdkEvent *event,
+ GtkWidget *widget,
+ const gchar *path,
+ GdkRectangle *background_area,
+ GdkRectangle *cell_area,
+ GtkCellRendererState flags );
+
+
+static GObjectClass *cell_parent_class = NULL;
+
+} // extern "C"
+
+GType
+gtk_wx_cell_renderer_get_type (void)
+{
+ static GType cell_wx_type = 0;
+
+ if (!cell_wx_type)
+ {
+ const GTypeInfo cell_wx_info =
+ {
+ sizeof (GtkWxCellRendererClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) gtk_wx_cell_renderer_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkWxCellRenderer),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gtk_wx_cell_renderer_init,
+ };
+
+ cell_wx_type = g_type_register_static( GTK_TYPE_CELL_RENDERER,
+ "GtkWxCellRenderer", &cell_wx_info, (GTypeFlags)0 );
+ }
+
+ return cell_wx_type;
+}
+
+static void
+gtk_wx_cell_renderer_init (GtkWxCellRenderer *cell)
+{
+ cell->cell = NULL;
+ cell->last_click = 0;
+}
+
+static void
+gtk_wx_cell_renderer_class_init (GtkWxCellRendererClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass);
+
+ cell_parent_class = (GObjectClass*) g_type_class_peek_parent (klass);
+
+ object_class->finalize = gtk_wx_cell_renderer_finalize;
+
+ cell_class->get_size = gtk_wx_cell_renderer_get_size;
+ cell_class->render = gtk_wx_cell_renderer_render;
+ cell_class->activate = gtk_wx_cell_renderer_activate;
+ cell_class->start_editing = gtk_wx_cell_renderer_start_editing;
+}
+
+static void
+gtk_wx_cell_renderer_finalize (GObject *object)
+{
+ /* must chain up */
+ (* G_OBJECT_CLASS (cell_parent_class)->finalize) (object);
+}
+
+GtkCellRenderer*
+gtk_wx_cell_renderer_new (void)
+{
+ return (GtkCellRenderer*) g_object_new (GTK_TYPE_WX_CELL_RENDERER, NULL);
+}
+
+static GtkCellEditable *gtk_wx_cell_renderer_start_editing(
+ GtkCellRenderer *renderer,
+ GdkEvent *WXUNUSED(event),
+ GtkWidget *widget,
+ const gchar *path,
+ GdkRectangle *WXUNUSED(background_area),
+ GdkRectangle *cell_area,
+ GtkCellRendererState WXUNUSED(flags) )
+{
+ GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer;
+ wxDataViewCustomRenderer *cell = wxrenderer->cell;
+
+ // Renderer doesn't support in-place editing
+ if (!cell->HasEditorCtrl())
+ return NULL;
+
+ // An in-place editing control is still around
+ if (cell->GetEditorCtrl())
+ return NULL;
+
+ GdkRectangle rect;
+ gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
+ &rect.x,
+ &rect.y,