Radio button issue

Hi, having issues with radio buttons. the projects open with them all checked, but they are not active. They can be unchecked but that is all?

Sorry for the late reply.
Did you solve your problem?
I haven’t been able to reproduce this.
First question, did you use the develop or the main branch?

N.B. I just pushed a new version to the main branch 1.3.8
The SignalGenerator example uses the new RadioButton manager and I just checked it worked here…

In the develop branch, I am seeing a second gesture being started by RadioButtonHandler::buttonClicked before the main ToggleButton’s onClick (mouse-up) handler has finished its gesture. Could they be on separate threads now? I don’t know when this appeared, but possibly when I upgraded to Mac OS Ventura 13.1. I’ll drill down further as soon as I need a RadioButton if not before. In the meantime, I’ve disabled RadioButtonHandler with this workaround:

diff --git a/State/foleys_RadioButtonManager.cpp b/State/foleys_RadioButtonManager.cpp
index 1ac2a43..3a17d2c 100644
--- a/State/foleys_RadioButtonManager.cpp
+++ b/State/foleys_RadioButtonManager.cpp
@@ -44,12 +44,19 @@ RadioButtonHandler::RadioButtonHandler (juce::Button& buttonToControl, RadioButt
     radioButtonManager.addButton (&button);
+#ifdef GESTURE_WITHIN_GESTURE_BUG_FIXED // JOS temp workaround
     button.addListener (this);
+    DBG("*** RadioButtonHandler is DISABLED until the double-gesture bug can be found and fixed");
+#ifdef GESTURE_WITHIN_GESTURE_BUG_FIXED // JOS temp workaround
     button.removeListener (this);
     radioButtonManager.removeButton (&button);

Thanks for the report. I can replicate the problem and am looking for a fix.

I don’t think it can come from different threads, AFAIK the message queue is always single threaded on mac.
And the crash happens here on Monterey too (12.6.2), so it’s probably unrelated to the update either.

I added some safety measures on develop, including SafePointers instead of raw pointers, and fixed a wrong destruction order in MagicBuilder. Unfortunately that is still not the full solution.

EDIT: I just found a dangling parameter listener, which caused the crash. I added a fix to develop, please let me know if it solves the issue. If it does I will push the new version to the main branch right after new year.

I am unfortunately still getting this assertion triggering:

    // This means you've called beginChangeGesture twice in succession without
    // a matching call to endChangeGesture. That might be fine in most hosts,
    // but it would be better to avoid doing it.
    jassert (! isPerformingGesture);
    isPerformingGesture = true;

I added JUCE_ASSERT_MESSAGE_THREAD to Button::setToggleState, and it does not fire, so that’s ok as you thought. I’ll test some more tomorrow after a deep clean and reboot. My experience with AU* plugin development to date indicates not to trust that a simple rebuild in Xcode will replace the previous state of everything. Things magically work then fail then work, all based on the same code.

Ok, I am still seeing this after rebooting et al. The problem seems to be that a Button click-listener is starting a gesture during the gesture of the main click, where the listener is the RadioButtonManager.

It turns out Button::setToggleState is called from other than the Message Thread by some hosts, according to pluginval (which I am using for validation testing - the assertion I put there finally fired).

I still wonder what I am doing differently. I use the button-radio-group and button-radio-value in the SignalGenerator example.
Then I tested in Logic and as stand-alone. It behaves as it should for me.