wx.RadioBox 'disappears' on Windows when labels empty

Dear all,

I have a problem with wx.RadioBox. I try to set up a line of radiobuttons with absolutely no label - i.e. I want that the radio buttons themselves be visible, but the labels must be empty.
The standard

wx.RadioBox(self, -1, …, 3*[’’], 3, wx.RA_SPECIFY_COLS)

works fine in Linux, but results in nothing being shown in windows. That looks as if in Win, when a wx.RadioBox item has no label, it is hidden by default.

I tried many workarounds (manually force the items to show, set a label to a value ‘a’ and then reset it to ‘’ later, etc…) but none worked. Any hints?

Paolo

PS: The reason I need it is the following: I need usrers to be able to input a number between 0 and 10 on a scale. I cannot use sliders as I do not want to have default options.
I came to this because I wanted to have a line of radio buttons with labels below the roundy button, and not to the right as it is currently; this is not possible, so I opted for a line with no labels and static texts at the two endpoints indicating the extreme values. This is turning out hellish as well…

Dear all,

I have a problem with wx.RadioBox. I try to set up a line of
radiobuttons with absolutely no label - i.e. I want that the radio
buttons themselves be visible, but the labels must be empty.
The standard

wx.RadioBox(self, -1, ..., 3*[''], 3, wx.RA_SPECIFY_COLS)

works fine in Linux, but results in nothing being shown in windows. That
looks as if in Win, when a wx.RadioBox item has no label, it is hidden
by default.

I tried many workarounds (manually force the items to show, set a label
to a value 'a' and then reset it to '' later, etc...) but none worked.
Any hints?

Try using a space for the labels.

Paolo

PS: The reason I need it is the following: I need usrers to be able to
input a number between 0 and 10 on a scale. I cannot use sliders as I do
not want to have default options.
I came to this because I wanted to have a line of radio buttons with
labels _below_ the roundy button, and not to the right as it is
currently; this is not possible, so I opted for a line with no labels
and static texts at the two endpoints indicating the extreme values.
This is turning out hellish as well...

You could always create a custom control that uses the RendererNative to draw a native looking "roundy button" and draws the text label where you want them to be. Add a few event handlers for mouse and keyboard and ta-da! you've got exactly what you need for your application.

···

On 3/12/12 11:45 AM, Paolo Crosetto wrote:

--
Robin Dunn
Software Craftsman