[Bug] ImageLists are slow and buggy

Report problems with documented functionality
kidbit
Posts: 168
Joined: 02 Oct 2013, 16:05

[Bug] ImageLists are slow and buggy

31 Oct 2014, 16:36

Drawing multiple 16x16 icons results into some icons being drawn wrongly (different icon from ImageListID gets used, or no icon at all).
question := (2b) || !(2b) © Shakespeare.
User avatar
joedf
Posts: 8959
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: [Bug] ImageLists are slow and buggy

31 Oct 2014, 16:42

code example? screenshot? :O
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
kidbit
Posts: 168
Joined: 02 Oct 2013, 16:05

Re: [Bug] ImageLists are slow and buggy

01 Nov 2014, 15:28

MasterScript.ahk navigate to a folder with multiple .ahk scripts on 1st tab and watch top right LV.
question := (2b) || !(2b) © Shakespeare.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: [Bug] ImageLists are slow and buggy

01 Nov 2014, 18:01

I followed your instructions and did not see any problems.

Why did you claim they are slow?

All of the actual work - creating the ImageList, adding icons into it, storing the image number for each ListView item, and drawing the icons - is done by MS code. AutoHotkey just passes the icon numbers you give it in LV_Add/LV_Modify to the ListView API.
kidbit
Posts: 168
Joined: 02 Oct 2013, 16:05

Re: [Bug] ImageLists are slow and buggy

02 Nov 2014, 13:02

try to navigate back and forth in the treeview at left between 2 folders with ~10-20 ahk scripts each.
You'll notice that listview at left sometimes gets list items without an icon.
Well, I don't know the internals, maybe it's MS's code is so buggy/slow.
question := (2b) || !(2b) © Shakespeare.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: [Bug] ImageLists are slow and buggy

02 Nov 2014, 14:45

Critical seems to help, at least I could not reproduce it with Critical:

Code: Select all

FolderTree:	; TreeView's G-label that should update the "FolderTree" TreeView as well as trigger "FileList" ListView update.
    Critical
kidbit
Posts: 168
Joined: 02 Oct 2013, 16:05

Re: [Bug] ImageLists are slow and buggy

02 Nov 2014, 16:30

HotKeyIt wrote:Critical seems to help, at least I could not reproduce it with Critical:

Code: Select all

FolderTree:	; TreeView's G-label that should update the "FolderTree" TreeView as well as trigger "FileList" ListView update.
    Critical
Well, for me critical didn't help and I still could reproduce the issue:
Image
As you can see in the listview at right some rows are missing icons.
question := (2b) || !(2b) © Shakespeare.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: [Bug] ImageLists are slow and buggy

02 Nov 2014, 19:57

The problem doesn't occur on my Windows 7 system.

It does occur in my Windows XP virtual machine - some icons appear momentarily and then disappear, one by one (but very quickly). I confirmed via SendMessage that the correct image index had been set. Setting "Icon1" again for all items after a delay appeared to work around it.

I did not see any item receive the wrong icon.

Anyway, I think it would be more accurate to say that ListViews have occasional problems rendering icons (in this script on some systems at least). I doubt it has anything to do with the ImageList.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: [Bug] ImageLists are slow and buggy

02 Nov 2014, 20:49

I think it has something to do with reentrancy caused by notification messages. The icons disappearing on certain items corresponds with an 'I' (item change) notification being received for that row. So some sort of interruption occurs while the item is being added, an item change notification is sent (even though it's a new item), and the icon disappears. I don't know what sort of item change (normally indicated by ErrorLevel), because part way through debugging I've lost the ability to reproduce the problem.

That is to say, the original script now works perfectly on both my Windows 7 system and my XP VM, without having made any changes to either system.

I was also unable to reproduce the problem with Critical, or without AltSubmit, which enables the 'I' notification. Critical negates some reentrancy problems because it prevents the script from checking for messages, particularly if you use Critical 10000 or similar.

Removing AltSubmit or gFileList temporarily while adding items would probably also work around the problem.
kidbyte

Re: [Bug] ImageLists are slow and buggy

03 Nov 2014, 04:09

lexikos wrote:I did not see any item receive the wrong icon.
You didn't, because I cut a single imagelist down to many smaller once. Combine them all together and correct the code to use correct index for icons from IL and you'll get wrong icons being assigned to LV rows as well.
kidbyte

Re: [Bug] ImageLists are slow and buggy

03 Nov 2014, 04:10

lexikos wrote:I think it has something to do with reentrancy caused by notification messages. The icons disappearing on certain items corresponds with an 'I' (item change) notification being received for that row. So some sort of interruption occurs while the item is being added, an item change notification is sent (even though it's a new item), and the icon disappears. I don't know what sort of item change (normally indicated by ErrorLevel), because part way through debugging I've lost the ability to reproduce the problem.

That is to say, the original script now works perfectly on both my Windows 7 system and my XP VM, without having made any changes to either system.

I was also unable to reproduce the problem with Critical, or without AltSubmit, which enables the 'I' notification. Critical negates some reentrancy problems because it prevents the script from checking for messages, particularly if you use Critical 10000 or similar.

Removing AltSubmit or gFileList temporarily while adding items would probably also work around the problem.
Thanks, I'll try that
kidbyte

Re: [Bug] ImageLists are slow and buggy

03 Nov 2014, 14:08

Neither removing gLabel and AltSubmit from vBookmarksList LV, nor setting critical 10000 to FolderTree label, nor both of these things at once helped.
123
Posts: 2
Joined: 20 Nov 2014, 03:21

Re: [Bug] ImageLists are slow and buggy

20 Nov 2014, 05:29

Forums don't matter: a bug is a bug.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Bug] ImageLists are slow and buggy

20 Nov 2014, 05:46

I think you did not understand just me's post.
Recommends AHK Studio
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: [Bug] ImageLists are slow and buggy

21 Nov 2014, 00:52

Ban this guy already and all of his accounts


Return to “Bug Reports”

Who is online

Users browsing this forum: ThePeter and 57 guests