Sets our main struct and passes it to the parent class
Creates a new GMenu. The new menu has no items. Since 2.32
Convenience function for appending a normal menu item to the end of menu. Combine g_menu_item_new() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Appends item to the end of menu. See g_menu_insert_item() for more information. Since 2.32
Convenience function for appending a section menu item to the end of menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Convenience function for appending a submenu menu item to the end of menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Marks menu as frozen. After the menu is frozen, it is an error to attempt to make any changes to it. In effect this means that the GMenu API must no longer be used. This function causes g_menu_model_is_mutable() to begin returning FALSE, which has some positive performance implications. Since 2.32
Get the main Gtk struct
the main Gtk struct as a void*
Convenience function for inserting a normal menu item into menu. Combine g_menu_item_new() and g_menu_insert_item() for a more flexible alternative. Since 2.32
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. Since 2.32
Convenience function for inserting a section menu item into menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Convenience function for inserting a submenu menu item into menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Convenience function for prepending a normal menu item to the start of menu. Combine g_menu_item_new() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Prepends item to the start of menu. See g_menu_insert_item() for more information. Since 2.32
Convenience function for prepending a section menu item to the start of menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Convenience function for prepending a submenu menu item to the start of menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more flexible alternative. Since 2.32
Removes an item from the menu. position gives the index of the item to remove. It is an error if position is not in range the range from 0 to one less than the number of items in the menu. It is not possible to remove items by identity since items are added Since 2.32
Removes all items in the menu. Since 2.38
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Emitted when a change has occured to the menu. The only changes that can occur to a menu is that items are removed or added. Items may not change (except by being removed and added back in the same location). This signal is capable of describing both of those changes (at the same time). The signal means that starting at the index position, removed items were removed and added items were added in their place. If removed is zero then only items were added. If added is zero then only items were removed. As an example, if the menu contains items a, b, c, d (in that order) and the signal (2, 1, 3) occurs then the new composition of the menu will be a, b, _, _, _, d (with each _ representing some new item). Signal handlers may query the model (particularly the added items) and expect to see the results of the modification that is being reported. The signal is emitted after the modification. See Also GActionGroup
Queries if model is mutable. An immutable GMenuModel will never emit the "items-changed" signal. Consumers of the model may make optimisations accordingly. Since 2.32
Query the number of items in model. Since 2.32
Queries the item at position item_index in model for the attribute specified by attribute. If expected_type is non-NULL then it specifies the expected type of the attribute. If it is NULL then any type will be accepted. If the attribute exists and matches expected_type (or if the expected type is unspecified) then the value is returned. If the attribute does not exist, or does not match the expected type then NULL is returned. Since 2.32
Queries the item at position item_index in model for the link specified by link. If the link exists, the linked GMenuModel is returned. If the link does not exist, NULL is returned. Since 2.32
Creates a GMenuAttributeIter to iterate over the attributes of the item at position item_index in model. You must free the iterator with g_object_unref() when you are done. Since 2.32
Creates a GMenuLinkIter to iterate over the links of the item at position item_index in model. You must free the iterator with g_object_unref() when you are done. Since 2.32
Requests emission of the "items-changed" signal on model. This function should never be called except by GMenuModel subclasses. Any other calls to this function will very likely lead to a violation of the interface of the model. The implementation should update its internal representation of the menu before emitting the signal. The implementation should further expect to receive queries about the new state of the menu (and particularly added menu items) while signal handlers are running. The implementation must dispatch this call directly from a mainloop entry and not in response to calls -- particularly those from the GMenuModel API. Said another way: the menu must not change while user code is running without returning to the mainloop. Since 2.32
GMenu is a simple implementation of GMenuModel. You populate a GMenu by adding GMenuItem instances to it.
There are some convenience functions to allow you to directly add items (avoiding GMenuItem) for the common cases. To add a regular item, use g_menu_insert(). To add a section, use g_menu_insert_section(). To add a submenu, use g_menu_insert_submenu().