Page 1 of 1

SF Symbols

Posted: Tue Feb 01, 2022 12:43 am
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.

Re: SF Symbols

Posted: Wed Feb 02, 2022 7:04 pm
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.

Re: SF Symbols

Posted: Thu Feb 03, 2022 1:58 pm
by mrbungle
Thank you very much!