After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662626 - Make selectable a property of GtkMenuItem
Make selectable a property of GtkMenuItem
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-10-24 16:37 UTC by Shaun McCance
Modified: 2018-02-10 03:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make selectable a property of GtkMenuItem (5.50 KB, patch)
2011-10-24 16:42 UTC, Shaun McCance
none Details | Review

Description Shaun McCance 2011-10-24 16:37:58 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).
Comment 1 Shaun McCance 2011-10-24 16:42:38 UTC
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.
Comment 2 Matthias Clasen 2018-02-10 03:33:44 UTC
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.