GtkCellRenderer: start editing with an initial value



Is there any way to make a GtkCellRendererText start editing, while also
specifying what text it should start with.
gtk_treeview_set_cursor_on_cell() can start the editing, but first it
puts the data from the tree model in the CellRenderer.

I want to do this in my GtkCellRendererText::edited signal handler so
that I can ask the user to edit the text again until it passes
validation. I'd like the user to start the second editing with the bad
text from the first edit, without ever putting the bad text in the
model.

I tried doing some of what gtk_treeview_set_cursor_on_cell() does,
including the strange cell_background, and cell_area stuff, but I'm not
sure what to pass for the widget parameter of
gtk_cell_renderer_start_editing():
http://developer.gnome.org/doc/API/2.0/gtk/GtkCellRenderer.html#gtk-
cell-renderer-start-editing

gtk_treeview_set_cursor_on_cell() seems to eventually get that widget
from the private gtk_tree_view_column_cell_process_action() function,
but I'm lost there.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]