GNOME Bugzilla – Bug 616850
GtkContainer signals for children added/removed
Last modified: 2018-04-15 00:26:41 UTC
I'd like to be able to watch a menu to know when menuitems are added or removed to it. I'm attaching a patch that changes gtk_menu_shell_insert() and gtk_menu_shell_remove() to emit "add" and "remove" signals (from GtkContainer).
Created attachment 159600 [details] [review] Proposed patch
Review of attachment 159600 [details] [review]: Looks like a good addition to me. I I have written workarounds for lack of this feature in the past, including custom containers. to build menues from.
Created attachment 162053 [details] [review] child-added / child-removed signals for GtkContainer So actually, that old patch doesn't really work and will just cause an infinite loop. "Oops!" :) But anyway, why don't we just have signals on GtkContainer that can be emitted whenever children are added and removed? ClutterContainer has this and it's incredibly useful.
Review of attachment 162053 [details] [review]: I like the idea, but the patch doesnt have documentation.
Created attachment 162130 [details] [review] Add some docs
Created attachment 162132 [details] [review] Added "since" docs Updated the docs to add "since" information, thanks to jjardon's suggestion.
*** Bug 730687 has been marked as a duplicate of this bug. ***
What's blocking this the above patch? As far as I can see it only adds "child-added" to GtkMenuShell, but not "child-removed", and it doesn't change other container subclasses (such as GtkBox) Would a patch that fixes the existing add signal to report the addition of all widgets be considered?
*** Bug 398241 has been marked as a duplicate of this bug. ***
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new