I tested in Xcode and it works.
Example:
https://www.youtube.com/watch?v=DL1ZzSu ... e=youtu.be
Link for custom appearance file. Put this into Contents/Resources
http://www.dipole-media.de/Test4.car
Hier the Xcode project. The function is in the ViewController file.
http://www.dipole-media.de/Theme%20Test%20%20C.zip
If the code works you will get a purple button if you click it.
Code: Select all
;@R Test4.car
Global Window_0, Button_0
;custom appearance
myAppearance = CocoaMessage(0, 0, "NSAppearance alloc")
appearanceNamed =CocoaMessage(0, myAppearance, "initWithAppearanceNamed:$", @"Test4", "bundle:", #nil)
;This works
; appearanceNamed = CocoaMessage(0, 0, "NSAppearance appearanceNamed:$", @"NSAppearanceNameVibrantDark") ;NSAppearanceNameVibrantDark, NSAppearanceNameVibrantLight
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
Case #PB_Menu_Quit
ProcedureReturn #False
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case Button_0
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
Window_0 = OpenWindow(#PB_Any, x, y, 450, 160, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Button_0 = ButtonGadget(#PB_Any, 160, 50, 130, 25, "OK")
CocoaMessage(0, WindowID(Window_0), "setAppearance:", appearanceNamed) ;<- this works not with the custom appearance
Repeat
event = WaitWindowEvent()
Until Window_0_Events(event) = #False