Wie kann ich das Event für diesen Zeitpunkt ausschalten?
Gruss
Code: Alles auswählen
Global x.l,y.l,*DC.l,start_p.f,ende_p.f,diff_p.f,gehe.l
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Declare zeichne()
Enumeration
#Window_0
#Button_0
EndEnumeration
Procedure zeichne()
start_p = ElapsedMilliseconds()
For gehe=0 To 12
For y=10 To 90
For x=200 To 232
SetPixel_(*DC,x,y,$0000ff)
Next
Next
Next
ende_p = ElapsedMilliseconds()
diff_p = ende_p-start_p
Debug "Gesamtzeit: "+Str(diff_p)+" ms"
EndProcedure
InitSprite()
OpenWindow(#Window_0, 400, 150, 500,500, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ButtonGadget(#Button_0, 10,10, 80, 25, "Zeichne")
Repeat
Event = WaitWindowEvent()
*DC = GetDC_(WindowID(#Window_0))
Select Event
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #Button_0
zeichne()
EndIf
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ReleaseDC_(WindowID(0), *DC)
ForEver
