Python Node: Customizing Radio Button Layout

Hi there :wave:

In a KNIME Python extension, a radio button can be created using knext.EnumParameter with its style parameter set to style=knext.EnumParameter.Style.RADIO.

By default, all the options are arranged from left to right and then top to bottom, like this:

multi_per_line

However, this layout can become cluttered and overwhelming, especially when the options are long and vary significantly in length.

Is there a way to control the visual arrangement of a radio button’s options?

For example, in my case, where the options are long and inconsistent in length, arranging them one per line would make the layout much more readable:

one_per_line

I’m aware of alternative styles like a dropdown, but before resorting to those, I want to make sure one cannot customize the radio button’s appearance to achieve this kind of layout.

Best
Lo

3 Likes

Hello @Loo,

I looked into the knext.EnumParameter.Style.RADIO option but wasn’t able to find a way to align it vertically (top to bottom).

As you mentioned above you can use either one of the ‘DROPDOWN’ or ‘VALUE_SWITCH’ option as below :

This might be a good candidate for a feature request, so I will move this to the feedback section.

Best,
Keerthan

2 Likes

Hi @k10shetty1,

Thank you for your response and for taking the time to look into this :grinning:

Best
Lo

1 Like