mirror of https://github.com/Gnucash/gnucash
Although gnome API usually insertions usually take ownership of the child element, in this case the GMenuItem attributes are copied into the GMenu. From https://docs.gtk.org/gio/method.Menu.insert_item.html -- * Description Inserts item into menu. The “insertion” is actually done by copying all of the attribute and link values of item and using them to form a new item within menu. As such, item itself is not really inserted, but rather, a menu item that is exactly the same as the one presently described by item. This means that item is essentially useless after the insertion occurs. Any changes you make to it are ignored unless it is inserted again (at which point its updated values will be copied). You should probably just free item once you’re done. There are many convenience functions to take care of common cases. See g_menu_insert(), g_menu_insert_section() and g_menu_insert_submenu() as well as “prepend” and “append” variants of each of these functions. Available since: 2.32pull/1692/head
parent
ff10b1d314
commit
fa3043a631
Loading…
Reference in new issue