@yusufcihan, a little question. What happens when I create components with your extension in a screen and I close that screen? Are the components destroyed from memory or do I need to use the Remove block before closing the screen?
Iâm mostly asking about the possible memory issues if I donât clear that memory the right way. Is that needed?
All components are just saved in a variable like a array/list, so it is same as when you storing a number, string etc in a variable. So one variable wonât cause any memory problems.
When screen closes all global variables backs to the their first value when you open again, so it is same for this extension.
To find the component name, I set an alert notifier in the initialize procedure. then add the âdummyâ component to it and it will print the full component name to the alert. Then look for what is printed before the @.
I used it to create a list of sorts. I have a parts list for various machines that are created dynamically. Each one is a horizontal layout with a checkbox and a textbox that is only visible if the checkbox is true so the user can enter the number of parts used. I used a few different procedures. One for creating the checkbox and setting the properties, One for the textbox, and one for each parts list entry. I then used a for each loop to run through a list and dynamically create each entry while adding each checkbox and textbox to lists so I could link them to each other.
I searched for it but find no answer - so I guess nobody ask for before
I created a scoreboard for a dice game with just over 50 buttons in 5 arrangements. To start a new round I have to initialize all the generated buttons.
Coming to my question.
Is it possible to implement a âClear Allâ and eg something like âClear All in Arrangementâ? I think such functions can be very helpful (not only for my scoreboard ). As a workaround I use the same âcreation loopsâ to delete the buttons one by one and than create them again.
You have given the answer @H_L. Use a loop to destroy the dynamic components and rebuild the dynamic components again. Make a function to do it, call it âClear_Allâ and you are done.
I would add all the buttons to a list and use a for each loop to remove them all. then just add the new group of buttons to that list afterward. Hell, you could start the creation procedure with that loop to ensure that they are destroyed prior to the next creation cycle.
That sounds useful. A block that copy one arrangement with all the components contained.
But with a little work with blocks, you can do that too.
You just have to create one arrangement and its dependent components as a sample, and use this same extension to âmultiply itâ all you want.
If you mean copying the components, then I need to create another extension as this extensionâs job is creating and deleting components dynamically.
However, in next release there are several new methods which allows you to set and get properties of any component (instead of using Any Component blocks anymore)
So this allows you to store componentâs properties in a list and set the same properties of the newly created components automatically by using a loop.