Problemns with ComboBox. HELP. HELP.

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Hello,
The next code don't work correctly. You can helpme???



InitGadget(2)
#WindowHeight = 334
#WindowWidth = 322

If OpenWindow(0,0,0, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget,"Your PURE BASIC application")

If CreateGadgetList(WindowID())

ComboBoxGadget(1,55,59,174,288)

EndIf
EndIf

Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget

Select EventGadgetID()

Case 1
ClearGadgetItemList(1)

For k=1 To 10
AddGadgetItem(1,-1, Str(k)+" : "+"Check")

Next

If GetGadgetState(1)
;If SetGadgetText(1, Str(GetGadgetState(1)))

Text$=GetGadgetText(1)
MessageRequester("Combo",Text$,0)
;EndIf
EndIf
EndSelect

EndIf
Until EventID = #PB_EventCloseWindow

End

Thanks,
Manolo
[url]mailto:vpardo@infonegocio.com[/url]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

You should specify which is the behavior intended. For me, it works (it doesn't crash or anything as that). And, please, use the code tag when posting code so no further formatting is required.

If your problem is that you don't get the "item selected" event, I have that problem, too, and I don't know how to solve it, sorry.

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Hi guys,
If your problem is that you don't get the "item selected" event, I have that problem, too, and I don't know how to solve it, sorry.
Ok Choni. I pasted with the ouput tag newly

Code: Select all

 InitGadget(2)  
#WindowHeight =  334 
#WindowWidth =  322 
   
If OpenWindow(0,0,0, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget,"Your PURE BASIC application")
   If CreateGadgetList(WindowID())
ComboBoxGadget(1,55,59,174,288)
  EndIf 
EndIf   
 Repeat 
  EventID = WaitWindowEvent()
   If EventID = #PB_EventGadget
     Select EventGadgetID()
       Case 1
       ClearGadgetItemList(1)
       For k=1 To 10
       AddGadgetItem(1,-1, Str(k)+" : "+"Check")
       Next
        ;If SetGadgetText(1, Str(GetGadgetState(1)));GetGadgetState(1)
         ; SetGadgetText(1, Str(GetGadgetState(1)))
          Text$=GetGadgetText(1)
          MessageRequester("Combo",Text$,0)
          ;EndIf
        ;EndIf
      EndSelect
    EndIf
 Until EventID = #PB_EventCloseWindow
End   
   
I have 1 week working in the solution, but I don't see. I need only the correct
selection item and presentation of the AddGadgetText in the first time. If this possible???.

Thanks to all for resolve this question.

Manolo
[url]mailto:vpardo@infonegocio.com[/url]


HAHAHAHAHA. New question from the forum !!!!!!!!!!!

Microsoft JET Database Engine error '80004005'

Not enough space on disk. ---------------------> what??? litle disk. hehe.

/purebasic/post_info.asp, line 591
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Hey Manolo !!

What do you want to do ??

Your Code doesnt tell me
what you are trying to do,
and i dont understand your
(english?) language.

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Hi again,

As I thought, Manolo, your problem is the same I had: the ComboBox doesn't fire an event when an item is selected, only when you click the gadget after selection. For some reason, I didn't post this problem before, but it's time to do it, because this bug or misfeature is really annoying. Anyway, if someone knows of a workaround to this, it will be welcome.

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Workaround:

Put an OK button beside the ComboBox. When you are done making your selection... press OK :)
Post Reply