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 616850 - GtkContainer signals for children added/removed
GtkContainer signals for children added/removed
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
: 398241 730687 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-04-26 14:18 UTC by Cody Russell
Modified: 2018-04-15 00:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (583 bytes, patch)
2010-04-26 14:18 UTC, Cody Russell
none Details | Review
child-added / child-removed signals for GtkContainer (1.08 KB, patch)
2010-05-26 21:51 UTC, Cody Russell
reviewed Details | Review
Add some docs (1.98 KB, patch)
2010-05-27 17:45 UTC, Cody Russell
none Details | Review
Added "since" docs (2.03 KB, patch)
2010-05-27 17:54 UTC, Cody Russell
none Details | Review

Description Cody Russell 2010-04-26 14:18:17 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).
Comment 1 Cody Russell 2010-04-26 14:18:39 UTC
Created attachment 159600 [details] [review]
Proposed patch
Comment 2 Christian Dywan 2010-04-27 13:06:00 UTC
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.
Comment 3 Cody Russell 2010-05-26 21:51:38 UTC
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.
Comment 4 Javier Jardón (IRC: jjardon) 2010-05-27 14:50:02 UTC
Review of attachment 162053 [details] [review]:

I like the idea, but the patch doesnt have documentation.
Comment 5 Cody Russell 2010-05-27 17:45:45 UTC
Created attachment 162130 [details] [review]
Add some docs
Comment 6 Cody Russell 2010-05-27 17:54:34 UTC
Created attachment 162132 [details] [review]
Added "since" docs

Updated the docs to add "since" information, thanks to jjardon's suggestion.
Comment 7 Matthias Clasen 2014-05-25 02:34:01 UTC
*** Bug 730687 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Martitz 2014-05-25 08:16:52 UTC
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?
Comment 9 Matthias Clasen 2014-12-08 12:07:08 UTC
*** Bug 398241 has been marked as a duplicate of this bug. ***
Comment 10 Matthias Clasen 2018-02-10 05:06:20 UTC
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.
Comment 11 Matthias Clasen 2018-04-15 00:26:41 UTC
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