Code: Alles auswählen
Global Paul.b
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Button_0
EndEnumeration
Procedure Mache()
Paul=0
Repeat
Debug "tue"
delay(10)
Until 0=1 or Paul ; schon komisch, dabei dürfen doch Variablen nicht mit einer Zahl anfangen.
EndProcedure
Procedure Open_Window_0()
If OpenWindow(#Window_0, 379, 170, 146, 67, "Dings",#PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ButtonGadget(#Button_0, 10, 10, 120, 40, "Mache",#PB_Button_Toggle)
EndIf
EndIf
EndProcedure
;/ Haupt
Open_Window_0()
Repeat
Event = WaitWindowEvent()
If Event=#PB_Event_Gadget
If EventGadget()=#Button_0
If IsThread( Thread)
Paul=1
Else
Thread= CreateThread(@Mache() ,0)
EndIf
EndIf
EndIf
Until Event=#PB_Event_CloseWindow
Ohne bunte Schrift weiß man doch wieder nicht, was gemeint ist.
Und für Anfänger dann zu unübersichtlich.


