Fill a ListIcon faster than with AddGadgetItem?

Just starting out? Need help? Post your questions and find answers here.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Fill a ListIcon faster than with AddGadgetItem?

Post 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
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post 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)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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.
I may look like a mule, but I'm not a complete ass.
Fred
Administrator
Administrator
Posts: 18161
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Post by guruk »

thanks for your effort.
I will try it out ...


greets
chris
Daffodil the Duck
User
User
Posts: 14
Joined: Mon Aug 15, 2005 10:14 pm
Location: Canada

IconListView Loading Time

Post 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.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Post 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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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:
I may look like a mule, but I'm not a complete ass.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

I've noticed one thing about this : it's a lot slower when we're adding an icon :?
TitaniumT
New User
New User
Posts: 6
Joined: Sun Aug 28, 2005 9:30 am

Splash screen while loading....

Post 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 ?..
TitaniumT
Post Reply