SF Symbols

Mac OSX specific forum
mrbungle
Enthusiast
Enthusiast
Posts: 117
Joined: Wed Dec 30, 2020 3:18 am

SF Symbols

Post by mrbungle »

Would anyone have any pointers on how to render SF Symbols in a UI - gadgets or menus? I've only seen examples for calling it in Swift vs the Cocoa function that PB supports. Thanks in advance.
User avatar
deseven
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Jan 12, 2011 3:48 pm
Location: Serbia
Contact:

Re: SF Symbols

Post by deseven »

Code: Select all

EnableExplicit

OpenWindow(0,#PB_Ignore,#PB_Ignore,300,200,"SF Symbols",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)

Define star = CocoaMessage(0,0,"NSImage imageWithSystemSymbolName:$",@"star","accessibilityDescription:",#Null)
ImageGadget(0,10,10,32,32,star)

CreateImageMenu(0,WindowID(0))
MenuTitle("SF Symbols")
MenuItem(0,"Star",star)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
You can find symbol names here.
mrbungle
Enthusiast
Enthusiast
Posts: 117
Joined: Wed Dec 30, 2020 3:18 am

Re: SF Symbols

Post by mrbungle »

Thank you very much!
Post Reply