Caching proxy menu items



It appears that the mail below which I wrote back in June never
actually reached the list:


When fixing 

        http://bugzilla.gnome.org/show_bug.cgi?id=142377

I noticed a problem with the way GtkToolItems create proxy menu
items. The fix for the bug makes the toolbar ask each overflown tool
item for its menu item so that the toolbar can hide the overflow arrow
if none of the overflown items have a proxy menu item.

This means that since the decision whether to show or hide the arrow
now depends on whether the children have a proxy items or not, a
resize needs to be queued whenever the item changes its mind about
whether to return items or not, and there is currently no way for the
toolbar to know when that happens.

We have the same problem when the overflow menu is shown. If an item
decides to stop having a menu item, that item should disappear from
the menu, but there is no way to make that happen currently.

So I propose adding

        gtk_tool_item_clear_proxy_menu_item ();

and make the documentation clear that the item set by

        gtk_tool_item_set_proxy_menu_item()

may be cached, ie. that there is no guarantee that the signal
CREATE_MENU_ITEM will be emitted before the menu item will be used
next time, so that if a tool item decides that the last item it
created is no longer good enough, it must call this function.

The same applies to GtkActions. There should be a
gtk_action_clear_menu_item() that is propagated to any created
toolitems. 


Søren



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]