Pb color with DateGadget

Just starting out? Need help? Post your questions and find answers here.
Yves86
New User
New User
Posts: 4
Joined: Fri Oct 01, 2021 5:13 pm

Pb color with DateGadget

Post by Yves86 »

Hi,
I want to use setgadgetcolor with a DateGadget, but it does'nt work with Window11. On MasOS only the BackColor work for the calendar and not for the string.

Does anybody have an idea ?
Thanks

Code: Select all

Enumeration 
  #wcal
  #cal
EndEnumeration

If OpenWindow(#wcal, 0, 0, 250, 250,"DateGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  DateGadget(#cal, 10, 10, 100, 25)
  SetGadgetColor(#cal, #PB_Gadget_FrontColor, #Blue)
  SetGadgetColor(#cal, #PB_Gadget_BackColor, #Yellow)
  SetGadgetColor(#cal, #PB_Gadget_TitleBackColor, #Yellow)
  SetGadgetColor(#cal, #PB_Gadget_TitleFrontColor, #Red)
  SetGadgetColor(#cal, #PB_Gadget_GrayTextColor, #Green)
  
  AddKeyboardShortcut(#Wcal,#PB_Shortcut_Escape,Key_esc)
  Repeat
    event_c = WaitWindowEvent() 
    Select event_c 
      Case #PB_Event_Gadget
        Event_Gadgetc = EventGadget()
        Select Event_Gadgetc
          Case #cal
            Debug Str(GetGadgetState(#cal)) + "  >> " + FormatDate("%dd/%mm/%yyyy",GetGadgetState(#cal)) + " -- " + GetGadgetText(#cal)
        EndSelect
      Case #PB_Event_CloseWindow
        Break
      Case #PB_Event_Menu
        Select EventMenu()
          Case key_esc
            Break
        EndSelect
    EndSelect
  ForEver
  RemoveKeyboardShortcut(#Wcal,Key_esc)
  CloseWindow(#Wcal)
EndIf

// Edit: Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)
Purebasic 6.12 LTS
Window 11, x64
Mac M1, OS 15.1
User avatar
Kiffi
Addict
Addict
Posts: 1503
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Pb color with DateGadget

Post by Kiffi »

No Bug

Uncheck "Enable modern theme support" in the Compiler Options

Image
Hygge
Yves86
New User
New User
Posts: 4
Joined: Fri Oct 01, 2021 5:13 pm

Re: Pb color with DateGadget

Post by Yves86 »

Thank you Kiffi.
It's OK
Purebasic 6.12 LTS
Window 11, x64
Mac M1, OS 15.1
Post Reply