> Le 25 juil. 2019 à 06:49, Garth Hjelte <ga...@chickensys.com> a écrit:
> 
> (Please don't laugh that I'm using MBS 16.4)
> 
> This is good code that works for me for extracting a icon from a FolderItem. 
> The context here is extracting the icons from the Volume() function.
> 
> This is an example function.
> 
> ********************
> Dim f As FolderItem
> Dim P As Picture
> 
> f = Volume(row)
> Dim n As NSImageMBS = NSWorkspaceMBS.iconForFile(f)
> if n <> Nil Then
>    // set the size we want
>    n.setSize 256, 256
>    // make a copy as picture
>    P = n.CopyPictureWithMask
>    if P <> Nil Then
>      Canvas1.Backdrop = P
>    end If
> end if
> ********************
> 
> My question is this: this works fine in all macOS, but it seems just in 
> Mojave that the mask doesn't exist - the background is black. Was this fixed 
> in later MBS's; if so, when - or is this just Mojave's behavior and is there 
> a better way of doing this?

That's very strange. I've just upgraded to Mojave one month ago; the “first” 
thing I noticed in my apps were the icons had a black background, using the old 
FolderItem.Icon (I didn't update my code); so I refactored my code to use the 
new NSWorkspace function (the same code you have above) and this fixed my 
issues everywhere. In other words, using NSWorkspaceMBS.IconForFile did the 
opposite to me: make things just work.
_______________________________________________
mbsplugins@monkeybreadsoftware.info mailing list
%(list_address)s
https://ml-cgn08.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to