Confirmed with Appearance Aqua
Code: Select all
Procedure EnableDarkMode(State)
Protected NSApp, NSAppearance
NSApp = CocoaMessage(0, 0, "NSApplication sharedApplication")
If Not State
NSAppearance = CocoaMessage(0, 0, "NSAppearance appearanceNamed:$", @"NSAppearanceNameAqua")
CocoaMessage(0, NSApp, "setAppearance:", NSAppearance)
CocoaMessage(0, 0, "NSAppearance setCurrentAppearance:", NSAppearance)
Else
CocoaMessage(0, NSApp, "setAppearance:", #nil)
CocoaMessage(0, 0, "NSAppearance setCurrentAppearance:", #nil)
EndIf
EndProcedure
EnableDarkMode(#False)
If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0, 10, 10, 250, 120)
For a = 1 To 12
AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview") ; define listview content
Next
SetGadgetState(0, 2) ; set (beginning with 0) the tenth item as the active one
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf