Page 1 of 1

Fill a ListIcon faster than with AddGadgetItem?

Posted: Mon Nov 07, 2005 7:36 pm
by guruk
Is there a way to fill a ListIcon faster than with this AddGadgetItem?

I have to fill a ListIcon with more than 50.000 Items.

When its in memory its so great and fast to handle.
Prob is.. to load it into the gadget needs Minutes !!

Any Idea?

Greets
Chris

Posted: Mon Nov 07, 2005 8:34 pm
by Pupil
You can momentary stop the gadget from updating the GUI while you fill the list. Try if this might work:

Code: Select all

SendMessage_(GadgetID(#Your_iconlist),#WM_SETREDRAW, #FALSE, 0)
; update your list here

; enable the drawing of the gadget again
SendMessage_(GadgetID(#Your_iconlist),#WM_SETREDRAW, #TRUE, 0)

Posted: Mon Nov 07, 2005 11:14 pm
by srod
If you're really desperate to speed things up then you could look into a 'virtual' List View whereby the application is responsible for looking after the contents of the List Icon. In this way, the data is only ever stored once (by the application) and not duplicated by Windows as part of its work in looking after the control.

When Windows needs to update the control etc. it fires off various messages to the application requesting the information it needs.

However, instead of populating the list icon item by item with text, you would have to populate the List View with all the callback items and I do not know how much time this might save (if any!) I've never actually used such a control.

It's probably a last resort and I admit, using a virtual list view is probably directed more at conserving memory than speeding things up!

Regards.

Posted: Mon Nov 07, 2005 11:57 pm
by Fred
srod: you're right, it will probably speed up a lot the initial loading and reduce memory. Also, the display speed shouldn't be impacted that much. This is know as MVC (Model View Controler) which is quite common in Java for example to have data duplication.

Posted: Tue Nov 08, 2005 2:53 am
by guruk
thanks for your effort.
I will try it out ...


greets
chris

IconListView Loading Time

Posted: Fri Nov 11, 2005 3:17 am
by Daffodil the Duck
And to join this debate I am going to ask something that I really don't know anything about so don't laugh but here goes anyway. If you wait the 3 minutes or more it takes to load 50,000 items into the list for the initial time only, is there then a way to save the chunk of memory that holds the data for the listview (intact) into for example, a binary file, so that on subsequent runs you can then load the binary file back into memory (intact) and point the treeview at it, rather than rebuild the list. There .... embarrassing but now I have proved to everyone that I really have no idea what I'm talking about, so don't laugh, but I am sort of having the same issue loading a tree with 20,000 rows. It takes over a minute to start the program.

Posted: Fri Nov 11, 2005 3:28 am
by guruk
Great ! I like this Way of thinking.

Right now I play with SQLite 3 and its fast.. with this and some other tricks my 50.000 should run into Mem withing 10 secs. Than LiveTime Recording and thats it. Only after Restart of the Program again the PreLoading. I am sure will find a way to do it faster.

Something like a Memory backup.. yes I also saw some Routines.. but have no Idea where to get the Pointers and how to code it.

/ chris

Posted: Fri Nov 11, 2005 11:07 am
by srod
Nice idea, but I don't think there's any way around the fact that when a list view control is created, it's list of rows is empty and they require populating one by one. We either populate them (row by row) with text, or with callback items in the case of a virtual list view. I'm guessing, but I would imagine Windows allocates memory on a row by row basis as needed and so I would be surprised if what you propose could work.

Course, I could be talking out my backside again! :D We'll soon find out when Sparkie wanders along! :lol:

Posted: Fri Nov 11, 2005 11:26 am
by Polo
I've noticed one thing about this : it's a lot slower when we're adding an icon :?

Splash screen while loading....

Posted: Sat Nov 12, 2005 12:26 pm
by TitaniumT
Hi all !

I created a small app that load a list of files to ListView at the opening of program. Sometimes, if there are so many files, it will load quite slow and showing the "white screen" at ListView area. I think we have to make a Splash screen waiting for loading finish.

Can you suggest the way to create a Splash screen without using JPG file ?..