Re: GtkExpander/GtkDisclosure



On Tue, 2003-03-11 at 18:34, Mark McLoughlin wrote:
> Proposal: GtkExpander/GtkDisclosure
> ===================================
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=60553
> 
> 	This is a simple widget with an expander triangle which when clicked on
> hides or shows contents of a container.
> 
> 	There have been two approaches to the widget so far:
> 
> 	1) Iain Holmes wrote a GtkCheckButton sub-class to which you can attach
> a GtkContainer which is shown/hidden as the button is toggled. This
> widget was intended for gnome-media but was later used by gsearchtool
> and gnome-panel. 
> 
> 	This approach has the advantage of a straightforward implementation and
> flexibility of how the expander button is laid out relative to the
> container.
> 
> 	2) I recently implemented a GtkBin sub-class which displays an expander
> arrow and label at the top of the widget and hides/shows the GtkBin
> child depending on whether the widget is expanded or collapsed.
> 
> 	This approach may make more sense conceptually - i.e. its a container
> whose child is shown or hidden rather than a widget that controls the
> state of another container. However, the implementation is a good deal
> more complex because a lot of it is a re-implementation of parts of
> GtkCheckButton and its base classes.
> 
> 
> 	I'm not sure there is too much point in enumerating each API until a
> decision is made on which approach to take.

My opinion is that if 2) allows for the right visual layout, then
it is more like the rest of the GTK+ API and probably easier to 
use as well for the programmer.

I wouldn't worry too much about the implementation ... API should
drive implementation not vice-versa. Plus, GtkCheckButton and
it's base classes are way-overcomplicated.

Regards,
                                           Owen





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