Code: Select all
If OpenWindow(0, 0, 0, 322, 340, "StringGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0, 8, 10, 306, 20, "StringGadget no background color") ; gadget has rounded edges with very faint enclosing lines
SetGadgetColor(0, #PB_Gadget_BackColor, #Red) ; no color
SetGadgetColor(0, #PB_Gadget_FrontColor, #Blue) ; I get color
StringGadget(1, 8, 40, 306, 20, "clicked-in to see color") ; no color till clicked
CocoaMessage(1, GadgetID(1), "setBackgroundColor:", CocoaMessage(0, 0, "NSColor systemRedColor")) ; no color using this
;SetGadgetColor(1, #PB_Gadget_BackColor, $0000FF) ; no color using this
TextGadget(2, 10, 70, 250, 20, "TextGadget looks normal") ; works fine with red square box filled
SetGadgetColor(2, #PB_Gadget_BackColor, $0000FF)
ExplorerTreeGadget(3,10, 100, 200, 200, "*.pb;*.pbi")
SetGadgetColor(3,#PB_Gadget_FrontColor,#Red) ; no color using this
SetGadgetColor(3,#PB_Gadget_BackColor,#Blue) ; I get color
;CocoaMessage(3, GadgetID(3), "setBackgroundColor:", CocoaMessage(0, 0, "NSColor systemRedColor")) ; I get color!
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf