Hey there.
I have a loop that creates widgets and I want to count the branch hits inside.
Eg.
- My Control Widget starts a “for loop”, creating 10 widgets
- My created widgets have a branch inside.
- I want to count how many times the branch is yes or no
- send that information back to the control widget.
I tried using delegates but I don’t want to bind them inside the created widget as I’td bind several times assumably. Equally, Delegates I feel don’t really go that way around.
I tried counting after the branch with incremental or ints, but It resets the counter on every creation, so renders it useless. I think this is the way still, but I just can’t work it out.
I tried creating a custom event that’d trigger every time the branch was hit inside control with the trigger being at the end of the created branch, but it comes up with accessed none.
I’m bit stumped, but it feels really easy, and I just can’t seem to kick my brain into the correct direction.
If anyone could put me out of my misery, I’d be appreciated.
Thanks