diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-03-22 17:24:46 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-04-01 16:45:19 -0400 |
commit | 5617b584202b1f967f287dfd03a4560975f1389b (patch) | |
tree | 293e53b55dad608d229ee0e59b81498a1c8f100b /gtk/gtkmodelmenuitem.h | |
parent | e250e52175d5f62e99c7491d95923ad521e1421c (diff) | |
download | gtk+-5617b584202b1f967f287dfd03a4560975f1389b.tar.gz |
Introduce GtkMenuTracker
GtkMenuTracker folds a nested structure of sections in a GMenuModel into
a single linear menu, which it expresses to its user by means of 'insert
item at position' and 'remove item at position' callbacks.
The logic for where to insert separators and how to handle action
namespaces is contained within the tracker, removing the need to have
this logic duplicated in the 3 or 4 places that consume GMenuModel.
In comparison with the previous code, the tracker no longer completely
destroys and rebuilds menus every time a single change occurs. As a
result, the new gtkmenu testcase now runs in approximately 3 seconds
instead of ~60 before.
https://bugzilla.gnome.org/show_bug.cgi?id=696468
Diffstat (limited to 'gtk/gtkmodelmenuitem.h')
-rw-r--r-- | gtk/gtkmodelmenuitem.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkmodelmenuitem.h b/gtk/gtkmodelmenuitem.h index 655f07341b..3f24163d5b 100644 --- a/gtk/gtkmodelmenuitem.h +++ b/gtk/gtkmodelmenuitem.h @@ -34,7 +34,7 @@ G_GNUC_INTERNAL GType gtk_model_menu_item_get_type (void) G_GNUC_CONST; G_GNUC_INTERNAL -GtkMenuItem * gtk_model_menu_item_new (GMenuModel *model, +GtkWidget * gtk_model_menu_item_new (GMenuModel *model, gint item_index, const gchar *action_namespace); |