You are right it does unnecessarily restrict the layout of the buttons. The
following structure is probably incorrect but the gist of it may be an option:
<BoxPane>
<RadioButton wtkx:id="oneButton" buttonData="One" selected="true"/>
<RadioButton wtkx:id="twoButton" buttonData="Two" />
<RadioButton wtkx:id="threeButton" buttonData="Three" />
<ButtonGroup wtkx:id="numbersGroup">
<ButtonGroupItem button="$oneButton" />
<ButtonGroupItem button="$twoButton" />
<ButtonGroupItem button="$threeButton" />
</ButtonGroup>
<PushButton wtkx:id="selectButton" buttonData="Select"/>
</BoxPane>
I would guess the ButtonGroup is not displayable.
Of course if it was possible to automatically generate an object of
Button.Group from the currently used syntax, that could be accessed via the
WTKXSerializer.get() method or @WTKX annotation, then it would save all that
typing ;-)
On Wed, 5 Aug 2009 12:17:57 pm Greg Brown wrote:
> Your suggestion makes sense, but might be a bit limiting. What layout
> rules would such a ButtonGroup container apply?
>
> The current approach allows you to choose a layout that makes sense
> (possibly distributing your buttons across multiple containers) yet
> still get the grouping behavior your app needs.
>
> On Aug 4, 2009, at 9:16 PM, Scott Lanham wrote:
> > Hello,
> >
> > I must be becoming one of those really annoying users.
> >
> > This is just my opinion and should be ignored at will.
> >
> > With button groups I think having a ButtonGroup container instance
> > to hold the
> > buttons is cleaner than having a static method that gets a
> > Button.Group. I
> > could then use something like:
> >
> > <BoxPane orientation="vertical" styles="{padding:4}">
> > <ButtonGroup wtkx:id="numbersGroup">
> > <RadioButton wtkx:id="oneButton" buttonData="One"
> > selected="true"/>
> > <RadioButton wtkx:id="twoButton" buttonData="Two" />
> > <RadioButton wtkx:id="threeButton" buttonData="Three" />
> > </ButtonGroup>
> > <PushButton wtkx:id="selectButton" buttonData="Select"/>
> > </BoxPane>
> >
> > Then in code:
> >
> > @WTKX private ButtonGroup numbersGroup;
> >
> > Which my little brain finds easier to work with rather than the
> > syntax in the
> > tutorial:
> >
> > final Button.Group numbersGroup =
> > Button.getNamedGroups().get("numbers");
> >
> > Cheers,
> >
> > Scott.