Re: Looking at EggToolbar



Soeren Sandmann <sandmann daimi au dk> writes:

> > what I might suggest instead is functions on EggToolItem
> > that look at the toolbar and get these configuration options:
> > 
> >  egg_tool_item_get_orientation()
> 
> What is this going to return when the item is not inside a toolbar?
> Are you required to pass in a toolbar?

I forgot my own suggestion here: Have gtk_toolbar_get_icon_size()
etc. and an EggToolItem::toolbar_reconfigured signal.


Another thing I forgot:

What are the precise semantics of 

        GtkWidget *EggToolItem::create_menu_proxy() ?

This call is supposed to return a menu item, and the caller must make
sure the item is destroyed. But who is responsible for keeping the
item up-to-date with respect to label and checked-ness and such? If
the tool item is responsible, then tool items need to keep a list of
weak references to all items ever created around and keep all those
menu items up-to-date.

I don't necessarily think this is a problem, but it may come as a
surprise. The code to maintain this list can be kept in the base class
and shared between tool item implementations.

Note that keeping one menu item around and handing references to that
out is not good enough, because this one menu item could then be added
to more than one menu.

I added code previously today to make toggle-items store one weak
reference to the latest menu item they created and keep it
up-to-date. This is good enough if at any time only one item created
by any particular item exists, but it doesn't seem sane to rely on
that.


Søren



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