Restored from previous forum. Originally posted by naw.
Hi,
I've got a problem with example ComboBox below - Am I doing something wrong?
If I create as an Editable Combo Box, I can retrieve items with GetGaddgetText()
that have been created using "AddGadgetItem() which is great...
But - If I overtype "HELLO WORLD" in the ComboBox, and try to retrieve it with GetGadgetText() it just returns blank.
- Tried posting this up in *Bug Reports* but no response & I'm a bit desperate to get
this fixed, so I would really appreciate any help/advice out there...
Ta - Nigel
OpenWindow(1,100,100,200,200,#PB_Window_SizeGadget,"XYZ") : CreateGadgetList(WindowID())
ComboBoxGadget(1,10,10,100,100,#PB_ComboBox_Editable)
AddGadgetItem(1,-1,"Item 1")
AddGadgetItem(1,-1,"Item 2")
AddGadgetItem(1,-1,"Item 3")
SetGadgetState(1,0)
TextGadget(3,20,70,150,30,"Type 'Hello World' above and press the 'Show' Button Below")
ButtonGadget(2,20,120,30,20,"Show")
Repeat
X=WaitWindowEvent()
Select X
Case #PB_EventGadget:
Select EventGadgetID():
Case 2: MessageRequester("X","Value in Combo Box is '"+GetGadgetText(1)+"'",0)
EndSelect
Case #PB_EventClosewindow: Quit=1
EndSelect
Until Quit=1
End
ComboBox Problems
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> Tried posting this up in *Bug Reports* but no response
Sorry, I meant to reply but forgot. Change the line in your code above to the
following and it will work, until Fred can do an official fix... and note that
this only works for the Windows version of PureBasic.
Case 2 : v$=Space(255) : GetWindowText_(GadgetID(1),v$,255) : MessageRequester("X","Value in Combo Box is '"+v$+"'",0)
PB - Registered PureBasic Coder
Edited by - PB on 27 June 2002 19:45:06
> Tried posting this up in *Bug Reports* but no response
Sorry, I meant to reply but forgot. Change the line in your code above to the
following and it will work, until Fred can do an official fix... and note that
this only works for the Windows version of PureBasic.
Case 2 : v$=Space(255) : GetWindowText_(GadgetID(1),v$,255) : MessageRequester("X","Value in Combo Box is '"+v$+"'",0)
PB - Registered PureBasic Coder
Edited by - PB on 27 June 2002 19:45:06