Page 1 of 1

macOS and Darkmode

Posted: Sat Dec 04, 2021 10:01 am
by mk-soft
I don't know if we want to have the IDE in macOS in dark mode or have a setting for it.
ButI think I want a setting.

With this code you can disable the dark mode.

Code: Select all

;-TOP

Enumeration Windows
  #Main
EndEnumeration

Enumeration Gadgets
  
EndEnumeration

Enumeration Status
  #MainStatusBar
EndEnumeration

CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
  Global NSApp.i = CocoaMessage(0, 0, "NSApplication sharedApplication")
  Global NSAppearanceAqua = CocoaMessage(0, 0, "NSAppearance appearanceNamed:$", @"NSAppearanceNameAqua")
  CocoaMessage(0, NSApp, "setAppearance:", NSAppearanceAqua)
CompilerEndIf

Procedure Main()
  
  #MainStyle = #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
  
  If OpenWindow(#Main, #PB_Ignore, #PB_Ignore, 800, 600, "Window" , #MainStyle)
    
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Break
      EndSelect
    ForEver
    
  EndIf
  
EndProcedure : Main()