Window Events
Posted: Thu Sep 29, 2005 5:25 pm
I have some questions about events and the way they operate. It could be my misunderstanding or bugs under Linux. The following code demonstrates the issues:
A) Mousing over ButtonGadget and ButtonImageGadget produces all 0’s for Event, Event Type, and Gadget Ids. Why have any event if you can’t distinguish which gadget it is on?
B) Mousing over ImageGadget does nothing.
C) Left click works on ButtonGadget and ButtonImageGadget, but not on ImageGadget.
D) Right click does not return correct values anywhere.
E) Left click in Window, outside of Gadgets, returns an Event but not the Left Click event. I can’t wait for a ‘0’ event, as in my real program I can not use WaitWindowEvent, and WindowEvent returns a constant string of ‘0’ events.
This test program runs quite different under Windows. Any thoughts?
Fedora Core 4 PB 3.94
Code: Select all
OpenWindow(0, 0, 0, 400, 300, #PB_Window_SystemMenu|#PB_Window_ScreenCentered, "Test")
CreateGadgetList(WindowID())
result = LoadImage(1,"graphics/but5.bmp")
If(result=0)
Debug "Can't Load Image"
EndIf
ImageGadget(2, 10, 10, 200, 60, UseImage(1))
ButtonImageGadget(3, 10, 110, 179, 60, UseImage(1))
ButtonGadget(4,10,210,100,50,"Test")
Repeat
Event.l = WaitWindowEvent()
Eventtype = EventType()
Id = EventGadgetID()
Debug "Event "+Str(Event)
Debug "Event Type "+Str(Eventtype)
Debug "Gadget ID "+Str(Id)
Debug " "
Until Event = #PB_Event_CloseWindow B) Mousing over ImageGadget does nothing.
C) Left click works on ButtonGadget and ButtonImageGadget, but not on ImageGadget.
D) Right click does not return correct values anywhere.
E) Left click in Window, outside of Gadgets, returns an Event but not the Left Click event. I can’t wait for a ‘0’ event, as in my real program I can not use WaitWindowEvent, and WindowEvent returns a constant string of ‘0’ events.
This test program runs quite different under Windows. Any thoughts?
Fedora Core 4 PB 3.94