Help Me ... I'm in Radio Button Hell

I have a very complex program that I wrote for a client and has been successfully in use for several years now. The client recently requested some additional features be added. One such feature requires trapping a mouse click on a certain listbox cell (using the CellClick event) and launching a window as a result. That new window contains some labels, push buttons, and two radio buttons placed on a Group Box. The radio buttons are set up as a control set with both initially being unchecked. I have used radio button control sets in numerous spots elsewhere in the program and have never had a problem … that is, until now.

Before I even added any code to the radio button set Action event (or any other event for that matter, including Open), I tested the app to see if the window properly launched when the user clicked on that listbox cell. And indeed it did launch as expected. But when I tried to click on either of the two radio buttons to select it, there was no response (i.e., no checked status … I could not check either one of them). The push buttons used on that same launched window work fine … It’s just the radio button set that won’t cooperate.

Has anybody ever run into this?

Windows 10
Xojo 2016 r1 (API 1)

Thanks in advance for your consideration,
… Don

BTW … if I throw a checkbox or two on that same launched window, they DO work properly. But if I put only a single radio button on that window, it just sits there and looks at me like I’m stupid when I try to click on it to set it.

How do you “launch” the window? Are you calling Window.Show, or a method on the window? Thinking the issue might have something to do with CellClick not having returned yet.

Thanks for your response, Julia. The window involved is set up as a moveable modal window. It is launched with Window.ShowModal. The listbox CellClick event does launch the window fine, and as I mentioned, EVERY other control works as expected EXCEPT the radio buttons, so I don’t think (emphasis on “think” :grin:) a timing issue involving it is the problem.

Just threw together a test app replicating your conditions as stated.

Works as expected under MacOS Ventura 13.3 and Windows 11 under Parallels with Xojo 2021r2.1.

Likewise, I can create a simple test project with a listbox on the Main Window and use it’s CellClick event to launch a separate window with the radio buttons. That DOES work. But the exact same approach within the confines of my original app does not work (radio buttons can’t be set) … that’s what’s confusing me. :scream:

At the risk of stating the obvious, in your actual project, are the radio buttons set as Enabled in the IDE (i.e, not dimmed-out?)

The GroupBox has to be enabled as well… :slight_smile:

Yep … but a valid question

Yep … like the radio buttons, all are set to Enabled in the IDE

Are the buttons properly parented by the GroupBox?

MouseDown event of the window or some other control is returning True?

Yep … made sure of this multiple times … even tried a few different parents (e.g., canvas, etc.)

Nope … great thought, Julia … but the launched window with the radio button set only has an Open event with one line of code that disables the button used to close the window (the button is enabled after the user makes a choice of one radio button or the other).

Your radio buttons are defective - maybe you can get them replaced under warranty :smiley:

2 Likes

Maybe some bug of that era.

Is that something that Geoff offers that I missed? :rofl:

Quite possible, Rick. I’ve spent two days trying this and that on this issue now without any love. I think I’m going to just use another selection method (popup menu, checkboxes, etc.) and quit beating my head against the wall (my wife doesn’t like all the marks it makes in her paint job :laughing:)

From that era, 2016r3 was the most stable one if I do recall correctly. And after it it was a mess for years. :rofl: Until 2019.

SegmentedControl offers the same functionality…

I might also suggest a PopupMenu as an alternative. It allows one selection, but will show you all options when the menu is open.