UpdateListIconGadget after all AddGadgetItem, SetGadgetItemState or SetGadetItemColor, makes the difference for speed
Window ListIconGadget With Owner Data (Very Fast)
Re: Window ListIconGadget With Owner Data (Very Fast)
Nicely done, thank you for sharing
UpdateListIconGadget after all AddGadgetItem, SetGadgetItemState or SetGadetItemColor, makes the difference for speed
UpdateListIconGadget after all AddGadgetItem, SetGadgetItemState or SetGadetItemColor, makes the difference for speed
Re: Window ListIconGadget With Owner Data (Very Fast)
Update v1.04.7
- Changed max columns count to auto column count
The count of columns is no longer limited and the item data is automatically adjusted.
The constant #LISTICON_COLUMN_SIZE indicates the starting value of the created columns
- Changed max columns count to auto column count
The count of columns is no longer limited and the item data is automatically adjusted.
The constant #LISTICON_COLUMN_SIZE indicates the starting value of the created columns
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Window ListIconGadget With Owner Data (Very Fast)
The biggest difference is the use of LVS_OWNERDATA. PureBasic needs about 300 ms to create 100000 items.ChrisR wrote: Sun Jan 04, 2026 12:53 pm Nicely done, thank you for sharing![]()
UpdateListIconGadget after all AddGadgetItem, SetGadgetItemState or SetGadetItemColor, makes the difference for speed
The ListView of MS several more than 50 seconds
Last edited by mk-soft on Mon Jan 05, 2026 8:13 am, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- Kwai chang caine
- Always Here

- Posts: 5601
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Window ListIconGadget With Owner Data (Very Fast)
Nice work
Have you planed to make manually editables cells ?
Have you planed to make manually editables cells ?
Re: Window ListIconGadget With Owner Data (Very Fast)
This would be a GridGadget and no ListIconGadget
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
- Kwai chang caine
- Always Here

- Posts: 5601
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Window ListIconGadget With Owner Data (Very Fast)
Aaaaah !!!
I hadn't noticed there was a difference.
So a gridgadget, is a manually editable listicongadget ?
And surely others options, but i don't know wich
So PB doesn't have Gridgadget, which is so useful.
Thanks HEXOR for have learning to me this différence
Re: Window ListIconGadget With Owner Data (Very Fast)
There were some quite good GridGadgets based on Canvas here in the forum, might be worth a search?
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
- Mindphazer
- Enthusiast

- Posts: 514
- Joined: Mon Sep 10, 2012 10:41 am
- Location: Savoie
Re: Window ListIconGadget With Owner Data (Very Fast)
Hi mk-soft
That's indeed, pretty fast !!
It takes about 10000 ms to fill a "standard" ListIconGadget with 20.000 elements, and... 31 ms with your method !
It will be very useful for me !!
Thanks a lot
That's indeed, pretty fast !!
It takes about 10000 ms to fill a "standard" ListIconGadget with 20.000 elements, and... 31 ms with your method !
It will be very useful for me !!
Thanks a lot
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 26.1 - Iphone 17 Pro Max - iPad at home
...and unfortunately... Windows at work...
...and unfortunately... Windows at work...
Re: Window ListIconGadget With Owner Data (Very Fast)
Update v1.05.1
- Added Item Images Support
- Bugfix AddGadgetColumn
I've expanded it a little bit
- Added Item Images Support
- Bugfix AddGadgetColumn
I've expanded it a little bit
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Window ListIconGadget With Owner Data (Very Fast)
Thanks for the improvements, images support, a nice ListIconGadgetEx
It would be a bonus if we could set colors on the header, as done here, of course, if it suits you
It would be a bonus if we could set colors on the header, as done here, of course, if it suits you
- Kwai chang caine
- Always Here

- Posts: 5601
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Window ListIconGadget With Owner Data (Very Fast)
Yes i know, there is several ListIcons manually modified on the forum, a style of basic EXCEL, because this subject really interesting me, since a long time, but :HeX0R wrote: Mon Jan 05, 2026 12:47 pm There were some quite good GridGadgets based on Canvas here in the forum, might be worth a search?
1/ I didn't know that was called a GridGadget (For me ListIcon and GridGadget were the same thing, before you told me.
2/ If I'm not mistaken, this Gridgadgets aren't based on virtual listicons.They're slow to load thousands of rows.
For the moment, unless I'm mistaken or have omitted something, i haven't find a working ListIcon very quick AND manually modified
Re: Window ListIconGadget With Owner Data (Very Fast)
Not fast, but works ...
Said's Canvas GridGadget
Link: viewtopic.php?f=12&t=54022
Last Update v2.4:
Link: https://github.com/mk-soft-65/MyGrid
But this is about the ListIconGadget from PureBasic and not a GridGadget.
Said's Canvas GridGadget
Link: viewtopic.php?f=12&t=54022
Last Update v2.4:
Link: https://github.com/mk-soft-65/MyGrid
But this is about the ListIconGadget from PureBasic and not a GridGadget.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- Kwai chang caine
- Always Here

- Posts: 5601
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Window ListIconGadget With Owner Data (Very Fast)
Thanks Mksoft
Yes i have see this splendid code, furthermore creating with a canvas, so starting from nothing, all by drawing... incredible
But i search something like EXCEL able to load numerous thousand of lines the most faster possible, exactely like your or RASHAD nice code
Unfortunately without cells editables
... This important function for me
I remember me, trying to modify the RASHAD code for adding this function, but like usually without succes
But now, thanks to HEXOR i have understand i must search virtual gridgadget for have this two functions together
Yes i have see this splendid code, furthermore creating with a canvas, so starting from nothing, all by drawing... incredible
But i search something like EXCEL able to load numerous thousand of lines the most faster possible, exactely like your or RASHAD nice code
Unfortunately without cells editables
I remember me, trying to modify the RASHAD code for adding this function, but like usually without succes
But now, thanks to HEXOR i have understand i must search virtual gridgadget for have this two functions together
- Michael Vogel
- Addict

- Posts: 2835
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Window ListIconGadget With Owner Data (Very Fast)
Great and slim - cool work, thank you.
I'll keep the version without image support also because this should include everything needed most of the time.
Maybe some flags like #ListIcon_EnableImageSupport combined with some CompilerIf could be used to create an all in one solution.
Editing cells would also add additional overhead even this functionality is not used. Maybe a simple StringGadget at the top/bottom outside the original code would be enough in some situations. I added a quick method to get the right column (windows only):
A call within the gadget event loop could look like this then (just for demonstration, no editing can be done here):
I'll keep the version without image support also because this should include everything needed most of the time.
Maybe some flags like #ListIcon_EnableImageSupport combined with some CompilerIf could be used to create an all in one solution.
Editing cells would also add additional overhead even this functionality is not used. Maybe a simple StringGadget at the top/bottom outside the original code would be enough in some situations. I added a quick method to get the right column (windows only):
Code: Select all
; AddOn
Procedure GetRowColumn(listicon,*row.Integer,*col.Integer)
Protected p.Point
Protected handle
Protected hCWnd
Protected header
Protected hi.LVHITTESTINFO
GetCursorPos_(@p)
handle=GadgetID(listicon)
ScreenToClient_(handle,p)
hCWnd= ChildWindowFromPoint_(handle,p\y<<32 + p\x)
header= SendMessage_(handle,#LVM_GETHEADER,0,0)
hi\pt= p
SendMessage_(handle,#LVM_SUBITEMHITTEST,0,@hi)
If hCWnd And hCWnd<>header
*row\i=hi\iItem
*col\i=hi\iSubItem
ProcedureReturn #True
EndIf
ProcedureReturn #Null
EndProcedure
Code: Select all
Case #PB_EventType_LeftClick
Protected row,col
If GetRowColumn(0,@row,@col)
StatusBarText(0,0,"R:"+Str(row)+" C:"+Str(col)+" = '"+GetGadgetItemTextEx(0,row,col)+"'")
EndIf
Re: Window ListIconGadget With Owner Data (Very Fast)
Edit:Michael Vogel wrote: Wed Jan 07, 2026 3:52 pm Great and slim - cool work, thank you.
I'll keep the version without image support also because this should include everything needed most of the time.
Maybe some flags like #ListIcon_EnableImageSupport combined with some CompilerIf could be used to create an all in one solution.
A #ListIcon_EnableImageSupport is not required. Only when an image is used, the required image list is created.
The time difference between the version with or without images is very small. Maybe a 1ms at 100000 items.
If you use the one without image support, you must clean up the AddGadgetColumn bug yourself.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
