GNOME Bugzilla – Bug 163851
headers-clickable property not readable + needs model set
Last modified: 2005-11-10 14:13:06 UTC
There seems to be a few oddities with the property headers-visible on the treeview. Attaching a small patch that changes a few things. First it makes the property readwrite instead of just writable. Then it removes a check in the setter that checks that there is a model set, which I can't find a reason for. I've also changed the name of the nick since it was "Visible" instead of "Headers Visible" to make it more usable. I'm not sure what the string policy is, so this part maybe needs to be removed.
(Changing subject, I actually meant headers-clickable, except for the string change)
Created attachment 35910 [details] [review] Above mentioned patch
This patch makes a lot of sense to me. I can't remember if we had any reason why it's write only and requires a model. I don't think we can commit the string change to stable, as we're string frozen, but please commit the code changes to HEAD and gtk-2.6.
2005-01-13 Matthias Clasen <mclasen@redhat.com> * gtk/gtktreeview.c: (gtk_tree_view_class_init), (gtk_tree_view_set_headers_clickable): Make the headers-visible property readwrite instead of just writable, and remove the g_return_if_fail check that there is a model when setting this property. Also improve the blurb. (#163851, Richard Hult)
Hm, I just noticed that there is no implementation in gtk_tree_view_get_property() for this property, and no getter. I wonder if there really was a reason for having this property readonly? I can't think of any though. Would it be possible to fix this in 2.6 or is it for 2.8?
I just ran into this, which seems related to comment 5 by Richard: >>> tv = gtk.TreeView() >>> tv.get_property('headers-clickable') /home/jdahlin/.pythonstartup:1: GtkWarning: gtktreeview.c:1280: invalid property id 5 for "headers-clickable" of type `GParamBoolean' in `GtkTreeView'
Created attachment 48160 [details] [review] v1: Adds getter and accessor for headers-clickable Do we need to notify if GtkTreeViewColumn::clickable changes? It'll be quite messy to check all the other columns to verify that the property really changed.
I think we should add a flag for headers-clickable to the tree view private struct, just as we have for headers visible. That would also allow us to fix the bug that columns which get added after calling set_clickable() won't be made clickable...
2005-11-10 Matthias Clasen <mclasen@redhat.com> * gtk/gtk.symbols: * gtk/gtktreeview.h: * gtk/gtktreeview.c: Implement a getter for headers-clickable. (#163851, Richard Hult)