I have not worked with Control Sets before, so pardon me if I got this completely wrong (or if this has been discussed already).
Just for explanation: I set up a new desktop project, put a button on the window , duplicated it twice, selected them all and made them member of a new group simultaneously. To this PushButton1 Set I added an action handler with
msgbox str(index) + " was clicked".
This works on OS X, but only fur button(0). Both the other buttons wont fire.
When I chose the long way and create a set from the first button and then add the others to it, it works as expected. Is there any reason why the same construction behaves differently? Or is this a (known?) bug (I couldnt find in Feedback)?
I just tried your method of creating a control set and got the same results. Guess you can’t do it that way. File a bug report if you wish, but I consider the other method, what you call the “long” way, simpler and clearer anyway.
[quote=125171:@Ulrich Bogun]I have not worked with Control Sets before, so pardon me if I got this completely wrong (or if this has been discussed already).
Just for explanation: I set up a new desktop project, put a button on the window , duplicated it twice, selected them all and made them member of a new group simultaneously. To this PushButton1 Set I added an action handler with
msgbox str(index) + " was clicked".
This works on OS X, but only fur button(0). Both the other buttons wont fire.
When I chose the long way and create a set from the first button and then add the others to it, it works as expected. Is there any reason why the same construction behaves differently? Or is this a (known?) bug (I couldnt find in Feedback)?[/quote]
Just tried. I confirm only one button fires. Except in my case, I created a first set the “long way”, then the second set your way, and now only button 2 fires in a set of 3. Tried to save and reload the project, bug stays.
[quote=125171:@Ulrich Bogun] I set up a new desktop project, put a button on the window , duplicated it twice, selected them all and made them member of a new group simultaneously. To this PushButton1 Set I added an action handler with
msgbox str(index) + " was clicked".[/quote]
I used these exact steps in Xojo 2014r2 and it worked as it should: each button put up it’s index.
could be a regression in 2.1 but I dont recall making changes to this in 2.1
but it doesn’t look like its unique to 2.1
the trick is DEFINITELy to create the button, duplicate it, then select all the copies & go to the inspector & the advanced tab & create new control set
Then adding an event to any of the controls should add it to all of them but its not - it seems to still add it to the one control only
No, I just set the first one to New Control Set, and set the others to Pushbutton1. I see now that I missed the “selected them all and made a control set” part. I’ll try it again.
There are indeed several ways to get all the controls in one set and why one should work better / worse than the others puzzles me
But I can reproduce Ulrichs events
I haven’t tried renaming them all at once which should also make a control set
If you select them all and change the Name, it prompts you to create a control set and everything works fine. It’s only when you select them and then go to the gear icon and select New Control Set in the Member Of field that it malfunctions.