Verfasst: 22.08.2007 13:42
Wenn dir ein WaitWindowEvent(50) zu lange dauert und WaitWindowEvent(5)
ein Flimmern hervorruft, kann man es auch so machen:
ein Flimmern hervorruft, kann man es auch so machen:
Code: Alles auswählen
mouse.POINT
oldmouse.POINT
oldmouse\x = -1 : oldmouse\y = -1
Repeat ; Start of the event loop
Event = WaitWindowEvent(5) ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
If Event = 0
mouse\y = DesktopMouseY()
mouse\x = DesktopMouseX()
If mouse\x <> oldmouse\x Or mouse\y <> oldmouse\y
oldmouse\x = mouse\x
oldmouse\y = mouse\y
SetGadgetText(#Y, Str(mouse\y))
SetGadgetText(#X, Str(mouse\x))
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop