Why doesn't $FF0000 show as Red ?
Code: Select all
SetGadgetColor(3, #PB_Gadget_FrontColor, $FF0000)
Code: Select all
; purebasic
If OpenWindow(0, 0, 0, 200, 500, "SetStringColor", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
; Create the font objects
Define VerdanaFont = LoadFont(#PB_Any, "Arial Black", 10)
Define TahomaFont = LoadFont(#PB_Any, "Arial Black", 14)
StringGadget(1, 10, 10, 180, 36, "1st String", #PB_String_ReadOnly)
SetGadgetFont(1, FontID(VerdanaFont)) ; Set font to Verdana for StringGadget(1)
StringGadget(3, 10, 100, 180, 36, "START", #PB_String_ReadOnly)
SetGadgetFont(3, FontID(TahomaFont)) ; Set font to Tahoma for StringGadget(3)
SetGadgetColor(3, #PB_Gadget_BackColor, $467061) ; String
SetGadgetColor(3, #PB_Gadget_FrontColor, $00FF00)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 1
Select EventType()
Case #PB_EventType_Focus
Debug "Case 1 String Focus"
Case #PB_EventType_Change
Debug "Case 1 String Change"
Case #PB_EventType_LostFocus
Debug "Case 1 String Lost Focus"
EndSelect
Case 3
Select EventType()
Case #PB_EventType_Focus
Debug "Case 3 String Focus"
SetGadgetColor(3, #PB_Gadget_BackColor, $467061) ; $DFDFDF) ; String
SetGadgetColor(3, #PB_Gadget_FrontColor, $FF0000)
SetGadgetText(3, "WORKING...")
Case #PB_EventType_Change
Debug "Case 3 String Change"
Case #PB_EventType_LostFocus
Debug "Case 3 String Lost Focus"
SetGadgetColor(3, #PB_Gadget_BackColor, $467061) ; String
SetGadgetColor(3, #PB_Gadget_FrontColor, $00FF00)
SetGadgetText(3, "START")
EndSelect
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End