> Le 22 janv. 2020 à 08:16, Christian Schmitz <[email protected]> > a écrit: > >> With this method, trying with the same folder as the “old” way (which >> contains only 25 files), each call to obtain an icon takes around 4-5 >> seconds, > > Sounds like something is broken. > Have you tried to reset the icon database?
Was that not a Mac OS classic-only method? I've found the “update launch services database” and made it. The problem is still here. I don't have another computer to try right now. I could try in a virtual machine, but I guess it's pointless. Is it faster on your side? This is my code: dim Item as FolderItem dim i,IconSizes() As integer dim Pict as picture //Define an item in “item” in this line IconSizes=Array(16,32,48,128,256,512,1024) for i=0 to UBound(IconSizes) pict=GetItemIcon(Item,IconSizes(i)) next Function GetItemIcon(Item as folderItem,Size as integer) if Item=nil then Return nil dim n As NSImageMBS=NSWorkspaceMBS.iconForFile(Item) n.setSize Size,Size Return n.CopyPictureWithMask End Function I would like to know if it's a problem on my computer or if it's the wrong way to get item's icons. > >> Clearly, the NSWorkspace way isn't the good one for my needs (is that just >> used to show a single, eventual, icon to the user?). Which other method >> would work? > > Use older plugins, older Xojo and continue to use IconFamily functions. Maybe > by using a helper app. Well, it would probably work, but I'd lose all the newer functions/fixes. Using a helper, I don't know how I'd pass the picture from one app to the other (sending as string using a socket wouldn't work, because I have to handle a possibly-huge number of icons). Another problem with the helper way is I'm making a console app. At any rate, if you think I'm using the correct code, I first have to figure out what's wrong. Thanks. _______________________________________________ [email protected] mailing list %(list_address)s https://ml-cgn08.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
