Blueman Posted January 17, 2019 Posted January 17, 2019 Hey Guys, Maybe you can help me with something small. It is not terrible but it slows down my script and after a while even crash the script. First i explain what i have; I have a GUI with a lot of GUICtrlCreateInput controls, lets say 600 pieces. All the controls are hidden when the GUI is displayed, i have 3 buttons attached to 200 pieces each. When i press button-1 the first 200 controls are showed, When i press button-2 the first 200 controls are hidden and the next 200 controls are showed, etc, etc. This is working perfectly but after a while the GUI is getting slower and slower. After a while the controls aren't responding anymore and the script crashes. When i compile the script to 64-Bits version the speed is a lot better but you can still see the script slowing down each time i use the buttons. I think there has to be a buffer somewhere that is filling each time i show and hide the controls, but how can i clear that buffer without restarting the script? Deleting and re-creating the controls didn't help, deleting the entire gui (and controls) and re-creating it didn't help also. The only thing that is working is restarting the script. Thanks guys! PS: If you need a working example i can add it to this topic, just let me know. It is not rocket science, i just create the controls and show/hide them with a while loop and 3 buttons.
Deye Posted January 17, 2019 Posted January 17, 2019 Blueman, Try to also toggle the disable\Enable state for the controls which you Hide\Show So that they dont interact with your loop .. Deye
Moderators Melba23 Posted January 17, 2019 Moderators Posted January 17, 2019 (edited) Blueman, Having so many controls and hiding/showing them has always been slow. You might like to look at this recent thread where someone wanted to have multiple inputs - it turned out that a ListView with my GUIListViewEx UDF (link on my sig) was able to replace the multiple inputs without creating the same problem. M23 Edited January 19, 2019 by Melba23 Added missing link MilenP 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MilenP Posted January 19, 2019 Posted January 19, 2019 I had the same problem, described here and I managed to fix it with the GUIListViewEx as @Melba23 suggested. I have rewrite the code and it is all flawless now! Thank you @Melba23, @Blueman, I am sure you will be able to to the same
Moderators Melba23 Posted January 19, 2019 Moderators Posted January 19, 2019 MilenP, Thanks for the endorsement. And for providing the link to the relevant thread - I thought I had done so but it appears not! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Blueman Posted January 21, 2019 Author Posted January 21, 2019 Guys, Thanks for the perfect sollution! I have tried that and it is working perfectly, and very quick. Didn't know that there was a (GUIListViewEx) Function that makes the list editable, what a great invention. Thanks all
Moderators Melba23 Posted January 21, 2019 Moderators Posted January 21, 2019 Blueman, Delighted you find my UDF useful. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Blueman Posted January 31, 2019 Author Posted January 31, 2019 On 21-1-2019 at 10:52 PM, Melba23 said: Blueman, Delighted you find my UDF useful. M23 Your The man, man! I just have one simple question, hope that i may ask you this. Is there a way to change the value in a certain column by clicking on a button? So Something Like: _GUIListViewEx_ChangeFieldValue($List_Index, $row, $col, $newvalue) Now i have looked at a way to do this by updating the array and then 'redraw' the list but this is a lot of work for every column. Thanks in advance! Greetings Wouter
Moderators Melba23 Posted January 31, 2019 Moderators Posted January 31, 2019 Blueman, The _GUIListViewEx_ChangeItem function should do what you require. May I suggest looking at the #CURRENT# section at the top of the UDF include file - it lists all the available functions within the UDF. And as with all of my UDFs each function has its own detailed header explaining the parameters and return values. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Blueman Posted January 31, 2019 Author Posted January 31, 2019 2 hours ago, Melba23 said: Blueman, The _GUIListViewEx_ChangeItem function should do what you require. May I suggest looking at the #CURRENT# section at the top of the UDF include file - it lists all the available functions within the UDF. And as with all of my UDFs each function has its own detailed header explaining the parameters and return values. M23 Melba, I have literally searched the whole UDF for a couple of hours for this function. I don't know why but i didn't saw it,.. what a stupid mistake from my side! Thanks for the answer, as Noobie as the question was,. You helped me a lot, thank you.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now