PB wrote:> Just check the events for your windows and gadgets, ignoring all other events
Very true!
Well, you are telling "very true" like it were necessarily wrong doing otherwise.
The doc says:
After an event of type #PB_Event_Gadget (returned by WindowEvent() or WaitWindowEvent()), use this function to determine which gadget has been triggered. It returns the #Gadget number.
If you get a #PB_Event_Gadget you MUST find the number of the gadget by calling EventGadget(), else the #PB_Event_Gadget shouldn't have been fired in the first place.
It shouldn't be needed to check for the window number like BorisTheOld does, if you need to check for that when you have only a window there is a bug in the logic PB follows to generate its custom #PB_ events. Even the examples in the PB manual don't do something like that, and for good reason. Shouldn't be needed.
You should use EventWindow() when you are using a single message loop to process the events for more than one PB window.
I agree with Danilo you should just check with eventgadget for the gadget numbers you expect to receive and nothing else, because usually it's the logical thing to do, but this doesn't change the fact the #PB_Event_Gadget shouldn't be fired if there is no valid gadget number to go with it. This is an event coming from where ? Why ? Why should be reported to me ? And why as a #PB_Event_Gadget when there is no gadget associated ?
Loos like a bug to me
