Radio Buttons Bug
-
UPDATE: after some testing with @David-Healey below, it turns out that radio buttons don't have to be in the same parent, but when they're aren't there's a bug that affects the callbacks.
Original post:
Posting it here in case it helps someone searching radio group buttons and why they aren't working.
I have 3 buttons I want to be mutually exclusive. They show info panels in the UI. I set them all to radioGroup 1. But only buttons 2 and 3 were working properly.
It took me 2 hours to try moving button 1 out of its parent panel, onto the same level as the other 2 buttons!

Note that the panels they're controlling can be anywhere in the hierarchy, but the buttons apparently MUST be at the same level, ie have the same immediate parent.
/// Doesn't work 😫 Panel Panel Button1 // this button has a different parent to the others Button2 Button3 Panel1 (controlled by Button1) Panel2 (controlled by Button2) Panel3 (controlled by Button3) /// Does work 🎉 Panel Button1 Button2 Button3 Panel1 (controlled by Button1) Panel2 (controlled by Button2) Panel3 (controlled by Button3) -
@dannytaurus Seems to be working here and the callback is triggered correctly.
HiseSnippet 977.3ocsV0saaaCElxwpKRasXEXO.B8Jkgh.KmFmDrVTW6jzYrkDi4rhcQAZoonhHhDo.EUqMF5KxtZ2r2pcwdD1av1g5mH4D2jXCTcg.O+7wyGOmC+YrTPnooBIxv974ITjw2XNYNWENLDy3nQGhLdj4I3TEU5TnZv7DbZJ0GYXrwq0JLrZix+92WN.Gg4DZsJD5MBFg9yrXlpV639+DKJ5XrO8bVbCueV+QDAenHRjA7YCyNnDL4R7EzSwZ2ZYh9QbZHx36M2mL0u2A938l1q2z87H9GDzw6.LkNcmc2eG5tjdDufd3NHiGbjOSIjSTXEMElzAB+4SBEejWDf2vRYSinZAOzDHxEpQCCYQ9iqRNoHjQ6w0opMJRUem4ILe1U5qSYeatAmZDMSZFstMJ4sBTxnAkZWPoGaNgHYIpZKZ970li3PEL.C0llTovWTq+xvbn.7fq1NFeI8XIHbEB2dc57TG32V+fsMTeRUNSyTJXfyKbpfcAU8pnngh3DAGjScexfbed6a8ehFWfP53Nygwqvtks0rsSoJ8DHEQCwQQSghsqfW3Pod.qkMiGw3TmfLNQwDbmq4iKoJrO04C3nL5V1+tsEKvwsTxxB7LUDQ2NQx3J2RJrMi6SmcVPM9sfv8oFg4TghdF2Me9r+jsy0MEDrTak7JhJWpYcSu71.5xyhmRkMWMZGgh7hcNO3904PJpQMbTvGwYpyRnkxGKh70cD5w2rOCUVjgNtMJYHLRk2u8nx9shpMhAShkYgfGJm9MOe.sBv6VA2zHG8J.cmqA8WGcHVg0aXJWIvpKgJULcRz3P5GfinJ19XYdHM8RkHI22xtBHQWDxGVs4ByoQ4QbSy7wdnY0KyS6OuVXT+Ox7UgZp7O.YBorKBUZo+vnHcdUL17djPmUsjlWMnb1qB266WEgJMOueBVBAnYjpHsD6yDuVJxRpJ8qBc51XQ2+8MWzeAo0WcGUhtE4n+rJGM.F74izU0l1KTa9aDZo0+askKOtOuJtmCCt953ywitvMh23fb3JDgeVDVs38J5abKM.GYrvg45Cr4oL07l63VgKa5bqW1beo3iMGyTjvkywVKgiPp9KAGKuh9glGEDPIpZB1173eacuO9NB+uHxTL9EmfURltc3zr3IvSYHTH5bnPmp6LZoOKqPtS0t3ITtetv+AekF8zxFkF8pLhhwDo3cjhCC0OBXybM.m34ORxBdsFH6biSeQnX3MIuiPVbptAvtqKvcVWfOacAt65Br25Bbu0E392MP8SFeUlRDWrsAgNY7Q42aYXbDGCcf4cqn+GvmTt.N
-
@David-Healey Well dayum!

Something is afoot. It definitely breaks here. Must be something else in my project.
Working (with btnShowPresetBrowser at same level as others):

Not working (with btnShowPresetBrowser in a different panel to others):

The second GIF shows the 2 icon buttons continue to work as normal but showing/hiding the preset browser breaks.
The only thing I change is the hierarchy position of the preset browser button.
Any ideas what else it could be if it's not the hierarchy?
-
@dannytaurus said in Radio Buttons MUST HAVE THE SAME PARENT
:Any ideas what else it could be if it's not the hierarchy?
Something in your script maybe. Can you make a minimal snippet that demonstrates it?
-
@David-Healey Yep, here's a minimal snippet.
HiseSnippet 1025.3ocsV8taaaCDmzNJc1csXEnO.B4S1CEAVwMNInCntwNtyXKod0cAaXenkRhJlHRjBTTI0aX.6QauE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zOGXLaSlGYbB7rpip.faYL5m97r1B5shXEiewoDkjoeT8r3foPafCEhNG5A0yov0zSTRo6no0UfoTtaBwMvuLgVZZblPqbgn.hiT7dmzoi5ck9hDN.l3I6U1.VvEnMsPISLKWmCfU2duiSUWcKC2aSMr6lZ3y2TC2eSMr2lZ3AapgG9oMTuY8qhUhfzqMHzoSNIYcCL9DNA5.S5VQ+C7O1w0HTo see it breaking, put btn1 inside the DifferentParent panel.
It looks like the buttons states do work correctly in the 'breaking' state, but the callbacks for the radio states don't trigger. So you end up with un-synced panel states.
-
@dannytaurus Yep, weird, looking into it
-
Yeah there's definitely a bug, the off action isn't triggered.
Each button press should trigger two actions, but we can see if the button in the panel is clicked only one action is triggered.
HiseSnippet 987.3ocuV8taaaCDmxNZKVasnEnO.B4SNqEAVIMNIqcXpwIoyXKIFysE6CEnklhJhHTjBTTs1XnC8QYuI6UZuAaG0ehjccRaMVmARfti2Od+3cGuiiTRBMMUpPVNOaVBEY8s1imIzQChvLAZ3QHqaaeJNUSUtEpNbVBNMkFfrrZ+TiBqNqgx+82+3gXNVPn0pPnWHYD5uvhY5Zsi7+YFmeBNf9LVbCqen+PhTLPxkY.eZa2CkfIWhufdF1XVKazOgSiPVem89jIA8OH.u2j98mrmGI3fvddGfozI6r696P2kzm3E1G2CY8UGGvzR0XMVSSQVqcnLX13H4aEEN3ErT1DN0H3gFCdtP8IRdf4HZzhFDw3AipBToHXWFUG1ZWD1tm8or.1U5qCe2IeA2ZDMCfVslmdsmiddMoWuFzaITxpAkVqfR20dLQwRz0qX3y2XOT.YyPLjmZRkBaQs9KK6ARvBgdqX7kzSTfvUH51uWuG3B+ayG43.4pTs6jLsF9v8GbqfcAU+DNefLNQJ.4ztabXtMu7kAaXvEJUtcm5xDUX2zoyzsRoZyFnj7AXNeBj36JEEFTpGv1wgI3LA0MLSPzLovcAa5Rpb6CbeClmQ2z42c5vkDLGbX.cJvyRutUt74g0PLjqCrQoRNcqDESn6Vf49ta398ve2ubOejy6ZPfyjZ54ht4dx4cNtKtTX3RWqjwbpZoKatZntIfcEYwSnplmSigP5e9ZJ6qulpYIOoH60vPoXnfoOOgJttKBnxTNT+0tjUvW57puaWV8Uj6QLnHqicgfGJmx.0rxu2+Y.c6UG5NUPq6Wgd9vivZr45S4IANcITklYBbVGQeCz7p3xTG6inoWpkI41VVv.sWJb6sptpgETdtWW2N+aOzzZGdl+rZgg9ukEnipU7G9QT1EQ08I+yY9lv5U9Z8Og.6zl8dm0TXAu85E8F5w9IXE3nldr5PnvAL4SUxrj4BeeVja6Fjy+09+eRtu9ijkZRMTPCp89Q2femmz9IKR52eo+xpUtwRzqqZ449K+TdcraaXJ6GLP.FEICx3X87ymLSwKW.ZvL2PASieQJSOqoO+Oan0mJEuq8HllDsbN1ZIbDtP+kfiki5uk8wggThtlfqYexu8kYtN5WkYZl3hSwZECJNrOKKdL77HBE7t.RzlF7VsLcBKj6U0ZbLUDjK7OvuxE8LxVkK5UsHJFSTxWQJZkZdLw54Z.NIxe3UG3Effrq2hcPQnX3sMuhPleq9.faup.2YUA9vUE3tqJv9qJv8VUf6+wAZd54Sxzx3hqMHzoiNNehmk0wBLTAlWsh9W.ayyi5Here's a roll your own solution that only requires one extra line of code
HiseSnippet 1097.3ocsW0laabCDkqjW2rpMAM.8.rH4OxMAFRxwx1HwnarrcqPqsEpRLJPRPBEWJIBSQtXWJGID3fbT5QpGgdD5Mvc39gVJEIWYgZ8CikCmGeONbFxwsBkDZTjLDYU5UiCnHquyt8Xgpei9Xl.07Pj0CrOAGongtIlNXb.NJh5irrJ9yZCVNqgh+8O+zAXNVPn4lPnykLB82XCXpbqs79UFmeL1m9J1.CuelWShTzPxkCA8TztBJ.St.2idJV6VAazufi5ir9Q6cIc7qumOdmN0q2YmpD+85Vo5dXJsyVau6VzsI0IU6VGWAYs9Q9LkLrsBqnQHq0NP5Otce4GEIDbNKh0gS0CphZCLmX9XI2WuE0VQM5y39sxBTQHXUZkG1JlD19A6SX9rI1yCeee7Dt4HLCfVElVdEmRdUMkWEC4MGIYYHo0RjzCsaSBYAp7Yz54asaJfSytX3bxTJI9hJ7lB1MjfGB0lCvWPONDFLAQ45Up7TW3Oa77RkfypHka.VP4Qt66lgpGU8RNugbPfT.iiJ+n.A+su0+QajAoyPkB93FwbPrOwv.p5JCcKOxkIxvtQImQaFQU5EHTxaf47NPtRYoHwgT6.VmRLAmIntcGJHJlT3NiOkIYz9T2Kw7gzMJ8oRNbIAyAB8oi.clx5lwiOqaNDs3bhUGCbqxycYtuXh2bpnmpOX6IOAzKrnNoy7F16zh+bMakys4t+9tlqriSRvM1cHoHSv2.hqbbJckwN8Tohdlnb7VpzUkbmcptcm6boLwogycZcYa3MArrX3fNzPy.p1QH0b57c6EmuaVNRRRSLbTJZJXpyBnhEUjhRysfZihopB9REWY7fzJijjLDCJ.brSFTEEKYnhn.5V.q1DXEuMv1x.1qadHVg0kxoJG1MAzPESGnrNjdIbQZRgsi8gznKTx.HdNolAtpKgt6mU1qychY6d1weWEMJ+t1S8FmOno2GY9p94F9rWeJqW+76r+ywd5v3Dt9lkHPNx7cfwlClgsOLKanW3EfCAhLXbxl.cqjQMCY38Au6TYrvHuoHP9Fh3KstAFlVddAyJuubgmNWYBP6kHcaQY.udg5n1xsSW2Ftkuhd8sspM048e8YuN8xdT2Y8rfOSQGXZ85qm1ZMSyKuDptnPMHiYn7Zm4RYp4KytJJthdIY27f9uCtI1uF834wdlYS1+5W1gdJj9C4X0zMZnaGKcB313odcW+BtHhoFa1t1+acerrR7g1sXJR+4qwByQivsg2EZLsms6aeT2tThJWfqYe7eb2zfF52kCULQuSvpPltJ4zgCZCm5DJvtP+JutxofNUOYbE8XcDnMU3GO3Z3W5jU0isRmrZ1jnAXRn78jj2ezcEduXKflDwcP6.sxCicm7HWdbd.zj56IjoWpuBXsUE3VqJvmsp.2dUAVeUAtypBb2+af5+GhWNTIGjT1fPmz5n31ErrNRfgLv3rUz+NcX9hN -
@David-Healey I'll investigate the bug.
-
@David-Healey Fix PR here: https://github.com/christophhart/HISE/pull/824
This ensures button callbacks are fired immediately.
Tested with my snippet above and confirmed working.

-
@dannytaurus Nice