Page 1 of 1

Posted: Sat Jan 18, 2003 4:47 pm
by BackupUser
Restored from previous forum. Originally posted by Kendrel.

I have tried to get the Current selected item inside a combo box with EventType, and it doesnt seem to work...

i have searched the forum and in some old message stood that it is buggy when used with a combobox... is that still buggy or was it an old bug?

i would need a short example, since i couldnt find anything usefull about this one

Posted: Sat Jan 18, 2003 5:22 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.

How do you mean, get the text of the current item or the item number of the current item?

I don't think EventType() has anything to do with how you get the current item in a combobox, not that i know of anyway..

Code: Select all

; To get the current item do this:
item = GetGadgetState(#Your_ComboBox) ; This one is in the PB manual

; To get the text of the current item do this:
text.s = GetGadgetText(#Your_ComboBox) ; This one isn't in the PB manual

Posted: Sat Jan 18, 2003 5:31 pm
by BackupUser
Restored from previous forum. Originally posted by Kendrel.

with item i ment the index...

but i have found out that it must be a bug

Select EventType()
Case #PB_EventType_RightClick ;Selected Item
Result=GetGadgetState(#ComboGadget)
EndSelect

i was thinking #PB_EventType_Change does the trick, but the example above just does what i need...

it seems EventType() is buggy... or the Constants... who knows!

Posted: Sat Jan 18, 2003 5:47 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.

> i was thinking #PB_EventType_Change does the trick, but the example above just does what i need...

well i does say in the manual that that particular eventype is for stringgadgets...
Quote from Purebasic Manual

#PB_EventType_Change : returned when a StringGadget() content change.