Re: Add GtkRadioGroup?



On Fri, 2010-10-29 at 12:43 +0900, Tristan Van Berkom wrote:
> On Thu, 2010-10-28 at 22:38 +0200, Alexander Larsson wrote:
> > One thing I remember being really confused about when learning gtk+ is
> > the GSList * usage for the group in GtkRadioButton. We have added some
> > scaffolding now that makes this somewhat better, but whats the chance of
> > actually fixing this by adding a real GtkRadioGroup class and using it
> > for radio buttons/menus/toolitems/actions?
> > 
> > It'll be a slight api break, but it should be trivial to fix up any
> > problems and the compiler should catch them all.
> > 
> > In addition to removing the GSList crap we can also add proper signals
> > for when the group contents changes (added/removed items) and a single
> > signal for the group when we get a new active item.
> > 
> > Below is a small example patch, mostly just compile tested. If there is
> > interest in doing this I'll try to find some time to do a full patch.
> > 
> > Opinions?
> 
> Hi,
>    I like the idea of not using the GSList too.
> 
> But I wonder, don't we already accomplish this with
> GtkRadioAction ?
> 
> I'm not sure the two entities would play nicely together
> either, maybe it makes sense to deprecate or even remove
> GSList interaction and just converge towards usage of
> a GtkRadioAction.

I'm not sure what you propose at all. GtkRadioAction and GtkRadioGroup
are different concepts. GtkRadioAction represent a single action item
with radio semantics, GtkRadioGroup is what chains a set of items with
radio semantics together.

GtkRadioGroup would replace the GSList in:

GSList   *gtk_radio_action_get_group (GtkRadioAction        *action);
void      gtk_radio_action_set_group (GtkRadioAction        *action,
                                      GSList                *group);

just like it would in GtkRadioButton.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl redhat com            alexander larsson gmail com 
He's a gun-slinging overambitious vagrant on the edge. She's a ditzy renegade 
Hell's Angel on the trail of a serial killer. They fight crime! 



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