ComboBoxGadget() - SetGadgetItemText() on selected Item

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

ComboBoxGadget() - SetGadgetItemText() on selected Item

Post by nco2k »

when using SetGadgetItemText() on the selected item, it becomes unselected and we have to reselect it again. it would be nice, if pb would do this automatically.

Code: Select all

If OpenWindow(0, 0, 0, 200, 30, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ComboBoxGadget(0, 5, 5, 190, 20)
  
  For i=0 To 4
    AddGadgetItem(0, i, Str(i))
  Next
  
  SetGadgetState(0, 3)
  
  Debug GetGadgetState(0); 3
  SetGadgetItemText(0, 3, "X")
  ;SetGadgetState(0, 3)
  Debug GetGadgetState(0); -1
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf : End
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf