GNOME Bugzilla – Bug 662626
Make selectable a property of GtkMenuItem
Last modified: 2018-02-10 03:33:44 UTC
Currently, whether a menu item can be selected is given by the semi-private _gtk_menu_item_is_selectable. This tests against a few things, one of which is whether it's a subclass (GtkSeparatorMenuItem). I propose making "selectable" a read-only property that subclasses can override (for e.g. separators, text headings, entries).
Created attachment 199846 [details] [review] Make selectable a property of GtkMenuItem First pass at making selectable a property. Two issues I'd like comments on: 1) Since the base implementation depends on whether the item has children, whether it's visible, and whether it's sensitive, I hook up to GtkContainer::add, GtkContainer::remove, notify::sensitive, and notify::visible. If a subclass overrides the property, this is still going to fire off notify::selectable, possibly when the property not changing value at all. 2) I just left _gtk_menu_item_is_selectable for now, to minimize the amount of code changed, but I changed it to a wrapper for the property. Three options there: a) Leave it as-is. b) Drop the leading underscore, put it in a public header, and make it a public accessor for the property. c) Replace all references to it with g_object_get.
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue for it.