recently I discovered by accident that an EXE program of mine, compiled with PB 4.20, did not run as expected on Windows 2000 SP 4. On Windows XP the program works fine.
Below you'll find a small example code that demonstrates the behaviour. On Windows XP, whether you assign 0 or a value <> 0 to #Method, the ComboBox will contain all 3 items, as expected. On Windows 2000 SP 4, using either method, the resulting ComboBox only contains the first item named "open". Can someone tell me what's going on there? Is this a bug in PB?
Regards, Little John
Code: Select all
; PureBasic 4.20
EnableExplicit
#Method = 0
#Title = "Combobox test"
#Window = 0
#Combo = 0
If OpenWindow(#Window, 400, 150, 200, 100, #Title, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar)
If CreateGadgetList(WindowID(#Window))
ComboBoxGadget(#Combo, 30, 30, 100, 20, #PB_ComboBox_Editable)
EndIf
EndIf
AddGadgetItem(#Combo, 0, "open")
SetGadgetState(#Combo, 0)
; Both following methods have no effect on Windows 2000 SP 4:
CompilerIf #Method = 0
AddGadgetItem(#Combo, 1, "print")
AddGadgetItem(#Combo, 2, "printto")
CompilerElse
AddGadgetItem(#Combo, -1, "print")
AddGadgetItem(#Combo, -1, "printto")
CompilerEndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

