SF Symbol toolbar icons on Big Sur?

So 2021r1 is out and it has the following listed against it:

  • SF Symbol toolbar icons on Big Sur.

Does that mean that we can use these symbols in toolbars or is it just talking about the IDE?

This is just about the Xojo IDE.

I had an idea that was it. I looked at Picture.SystemImage and it still said iOS only :frowning:

I’ve made my own way of doing it but was hoping for improvement.

You could use NSImageMBS in MBS Xojo Plugins:

Dim n As NSImageMBS = NSImageMBS.imageWithSystemSymbolName("trash")
If n <> Nil Then
  
  n.setSize(300,300)
  Backdrop = n.CopyPictureWithAlpha
  
End If

Thanks, but as I said “I’ve made my own way of doing it but was hoping for improvement.”

I would advise against rasterizing a system graphic in this way, as it will create performance constraints (rasterizing the image at runtime and using an large that is way too large).

I would suggest either.

  • Using the SF Symbol graphic directly, as this will keep memory and performance issues to a minimal, however this means it will only work on Big Sur and newer.
  • Pre-rasterizing the SF Symbol to the correctly sized images outside of the app and using API to load the images from the resources folder. Which is compatible with Big Sur and below.
2 Likes