> David Hiltz wrote:
> >   I saw this question posted before - but no answer.  Is there a way to
> >   have multiple groups of Radiobuttons?  
> >  
> >   Maybe there is a flag like:
> > 
> >        -group => 'group-name'
> > 
> >   Tried it but ... no.  :(
> 
> use 
> 
>     -group => 1 
> 
> to mark the start of a new group; example:
> 
>     # first group:
>     $Window->AddRadiobutton( ... );
>     $Window->AddRadiobutton( ... );
>     $Window->AddRadiobutton( ... );
> 
>     # second group:
>     $Window->AddRadiobutton( -group => 1, ... );
>     $Window->AddRadiobutton( ... );
>     $Window->AddRadiobutton( ... );

  Drawback is if you move the objects around in the file.  

> BTW, I'm thinking about a AddRadiobuttons() method that
> will automatically add an entire group, like this:
> 
>     $Window->AddRadiobuttons(
>         -text => [ "One", "Two", "Three" ],
>         -pos  => [ 100, 100 ],
>         -height => 20,
>     );
> 
> this will add three Radiobuttons at (100, 100), (100, 120)
> and (100, 140); there will probably also be an -horizontal => 1
> option...
> what do you think about it?

    Makes more work for my GUI Builder.  :(

    I would think that changing the existing '-group' option so related
    Radiobuttons use the same keyword or number would clearly show which
    Radiobutton belong together, eg.

     $Window->AddRadiobutton( -group => 'colors', ... );
     $Window->AddRadiobutton( -group => 'colors', ... );
     $Window->AddRadiobutton( -group => 'colors', ... );
 
     # second group:
     $Window->AddRadiobutton( -group => 'animals', ... );
     $Window->AddRadiobutton( -group => 'animals', ... );
     $Window->AddRadiobutton( -group => 'animals', ... );

  -David Hiltz

Reply via email to