Better EventHandling needed!
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by MrVainSCL.
Seems PB have some probs to handle events correctly! For example ComboBox, Network...
So we really need a better and correct working event handling system!
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Seems PB have some probs to handle events correctly! For example ComboBox, Network...
So we really need a better and correct working event handling system!
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by pbdep.
Can you give an example of these? Im just currious.
Regards,
Norman.
Hello MrVainSCL,Originally posted by MrVainSCL
Seems PB have some probs to handle events correctly! For example ComboBox, Network...
So we really need a better and correct working event handling system!
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Can you give an example of these? Im just currious.
Regards,
Norman.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by MrVainSCL.
Hello pbdeb,
write a small program using a Cobobox with some different stuff to select... If you press the Combobox Gadget we will get an event... But now we are inside the list to select any entry... When selecting any entry Combobox will not return a new event for exampe...
Btw ask Tranquilizer, who have some Eventproblems with other stuff too.
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Hello pbdeb,
write a small program using a Cobobox with some different stuff to select... If you press the Combobox Gadget we will get an event... But now we are inside the list to select any entry... When selecting any entry Combobox will not return a new event for exampe...
Btw ask Tranquilizer, who have some Eventproblems with other stuff too.
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Kale.
it seems to work fine for me?
http://www.reelmediaproductions.com/pb/ ... erv401.zip
here i use a few and all work well! or maybe im missing what you mean?
--Kale
New to PureBasic and falling in Love!
it seems to work fine for me?
http://www.reelmediaproductions.com/pb/ ... erv401.zip
here i use a few and all work well! or maybe im missing what you mean?
--Kale
New to PureBasic and falling in Love!

-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> write a small program using a Cobobox with some different stuff to
> select... If you press the Combobox Gadget we will get an event...
> But now we are inside the list to select any entry... When selecting
> any entry Combobox will not return a new event for exampe...
Yes it does... selecting anything in the code below always returns
an event... so what's the problem?
> write a small program using a Cobobox with some different stuff to
> select... If you press the Combobox Gadget we will get an event...
> But now we are inside the list to select any entry... When selecting
> any entry Combobox will not return a new event for exampe...
Yes it does... selecting anything in the code below always returns
an event... so what's the problem?
Code: Select all
If OpenWindow(0,150,150,300,200,#PB_Window_SystemMenu,"test")
CreateGadgetList(WindowID())
ComboBoxGadget(0,10,10,100,150,0)
ButtonGadget(1,120,10,50,20,"test")
For r=1 To 10 : AddGadgetItem(0,-1,Str(r)) : Next
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
Select EventGadgetID()
Case 0
Debug "combo event -- selection: "+Str(GetGadgetState(0)+1)
Case 1
Debug "button event"
EndSelect
EndIf
Until ev=#PB_Event_CloseWindow
EndIf
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tranquil.
@PB:
Yes you are right, there are events reported but you have to to work-arrounds if you want (for eg) to open a specified window on a combogadget event. PB returns two events and thats a hazle couse the Combobox looses focus by creating the window on the first event.
This has advanteged and disadvanteges. By the way, this is not mentioned in the documentation and can made ppl ugly who uses ComboBoxes first time.
Cheers
Mike
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
@PB:
Yes you are right, there are events reported but you have to to work-arrounds if you want (for eg) to open a specified window on a combogadget event. PB returns two events and thats a hazle couse the Combobox looses focus by creating the window on the first event.
This has advanteged and disadvanteges. By the way, this is not mentioned in the documentation and can made ppl ugly who uses ComboBoxes first time.
Cheers
Mike
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> PB returns two events and thats a hazle couse the Combobox looses
> focus by creating the window on the first event.
When you click the gadget, you will naturally get a click event.
When you open a new window, you naturally get a lose-focus event on
the gadget, followed immediately by a get-focus event on the window.
That's perfectly normal and expected. Events occur all the time and
it's the programmer's job, and not PureBasic's, to handle the events.
> PB returns two events and thats a hazle couse the Combobox looses
> focus by creating the window on the first event.
When you click the gadget, you will naturally get a click event.
When you open a new window, you naturally get a lose-focus event on
the gadget, followed immediately by a get-focus event on the window.
That's perfectly normal and expected. Events occur all the time and
it's the programmer's job, and not PureBasic's, to handle the events.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tranquil.
Thats right PB, but some gadgets reports only one event, others more. there is no standard that I can see. Its better to report one more event as one is missing. Thats why I said you have to use workarrounds.
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
Thats right PB, but some gadgets reports only one event, others more. there is no standard that I can see. Its better to report one more event as one is missing. Thats why I said you have to use workarrounds.
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Berikco.
There are no events missed.
Regards,
Berikco
http://www.benny.zeb.be/purebasic.htm
Yes, PB is right, its the programmer's job to handle the events, this is not a workarround. And the standard (or no Standard )is set by M$.Originally posted by tranquil
Thats right PB, but some gadgets reports only one event, others more. there is no standard that I can see. Its better to report one more event as one is missing. Thats why I said you have to use workarrounds.
There are no events missed.
Regards,
Berikco
http://www.benny.zeb.be/purebasic.htm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
EventType() is already there, but doesnt work correct
for all Gadgets.
cya,
...Danilo
(registered PureBasic user)
Code: Select all
If OpenWindow(0,150,150,300,200,#PB_Window_SystemMenu,"test")
CreateGadgetList(WindowID())
ComboBoxGadget(0,10,10,100,150,0)
ButtonGadget(1,120,10,50,20,"test")
For r=1 To 10 : AddGadgetItem(0,-1,Str(r)) : Next
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
Select EventGadgetID()
Case 0
If EventType() = 1
Debug "combo event -- selection: "+Str(GetGadgetState(0)+1)
EndIf
Case 1
Debug "button event"
EndSelect
EndIf
Until ev=#PB_Event_CloseWindow
EndIf
for all Gadgets.
cya,
...Danilo
(registered PureBasic user)