For some reason EventGadget() is -1 upon opening the window when I set a default text for any of the StringGadgets. That causes a compiler error with SetGadgetColor() for example. Does anyone know why?
I reproduced this behaviour with the example from the help.
Code: Select all
; Shows possible flags of StringGadget in action...
If OpenWindow(0, 0, 0, 322, 205, "StringGadget Flags", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0, 8, 10, 306, 20, "Normal StringGadget...")
StringGadget(1, 8, 35, 306, 20, "1234567", #PB_String_Numeric)
StringGadget(2, 8, 60, 306, 20, "Read-only StringGadget", #PB_String_ReadOnly)
StringGadget(3, 8, 85, 306, 20, "lowercase...", #PB_String_LowerCase)
StringGadget(4, 8, 110, 306, 20, "uppercase...", #PB_String_UpperCase)
StringGadget(5, 8, 140, 306, 20, "Borderless StringGadget", #PB_String_BorderLess)
StringGadget(6, 8, 170, 306, 20, "Password", #PB_String_Password)
Repeat
event = WaitWindowEvent()
If event = #PB_Event_Gadget ;imho, should not fire before the gadgets are created, seems to fire upon setting the text for a gadget
Debug EventGadget()
EndIf
Until event = #PB_Event_CloseWindow
EndIf
I mean it's not like I called EventGadget() before checking if a #PB_Gadget_Event occured.


