How to use Buttongroup to make Horizontal Radio Selections?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zombieCraig
:warning: Old Version Published before Godot 3 was released.

When creating a button group and adding checkboxes, I get the radio button style that I was looking for. However, every checkbox is listed vertically and I can’t seem to get them to fill in horizontally.

I have:

  • ButtonGroup
    – Option1
    – Option2

And that’s how it renders. So I want to have the the visual listed vertically like:

( ) Option1 ( ) Option2…

However Button group is forcing a top down selection list. I feel I’m just missing something simple. Any Ideas?

:bust_in_silhouette: Reply From: jackmakesthings

Try adding an HBoxContainer as a parent for your options - they’ll still work as exclusive radios even if they’re not direct children of the ButtonGroup, so this hierarchy is fine and should create the layout you need:

  • ButtonGroup
    – HBoxContainer
    ---- Option 1 (CheckBox)
    ---- Option 2 (CheckBox)

Note that the HBoxContainer, unlike the ButtonGroup, only applies its special container mojo (in this case, the horizontal layout) to its direct children. So you can have as many other layers of node hierarchy as you want between ButtonGroup and the HBox, but none between the HBox and the options.