GNOME Bugzilla – Bug 691660
'treerow[idx] = None' complains 'Argument 3 does not allow None as a value'
Last modified: 2013-01-13 21:28:39 UTC
Trying to update a tree row with treerow[idx] = None fails like: TypeError: Argument 3 does not allow None as a value This convenience syntax maps to gtk_tree_store_set_value, so I tried the obvious: diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 21e7a20..9830caf 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -937,7 +937,7 @@ gtk_tree_store_real_set_value (GtkTreeStore *tree_store, * @tree_store: a #GtkTreeStore * @iter: A valid #GtkTreeIter for the row being modified * @column: column number to modify - * @value: new value for the cell + * @value: (allow-none): new value for the cell * * Sets the data in the cell specified by @iter and @column. * The type of @value must be convertible to the type of the However that hits an assertion since it requires a gtk value. All this worked with pygtk2 bindings. My usecase is a tooltip column: setting it to an empty string still shows an empty tooltip, so you want to be able to set None. Appending a row to a treestore doesn't complain about any None values. Maybe this is entirely a gtk issue but since there seems to be some magic glue here I figured I'd try here first, please reassign if necessary.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 684094 ***