Jump to content

Slow GUI After Multiple Actions


Blueman
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

  • Moderators

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 by Melba23
Added missing link

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 :)

 

Link to comment
Share on other sites

  • Moderators

Blueman,

Delighted you find my UDF useful.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 weeks later...
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
 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...