This is my problem:
With the following code I sometimes get the memory access error or external lib error if I try it in linux mint 21.3.
With Windows it works fine.
Does anyone know the reason?
I am using Purebasic 6.04
Code: Select all
Enumeration
#Win_0
#Btn_0
EndEnumeration
EnableExplicit
Define.i i,Event
Define.b srot
Procedure Anim_Win(srot) ;srotola\arrotola la finestra
Protected i
If srot=1 ;srotola
For i=136 To 520 Step 8
ResizeWindow(#Win_0, #PB_Ignore, #PB_Ignore,#PB_Ignore,i)
Delay(2)
Next i
Else ;arrotola
For i=520 To 136 Step -8
ResizeWindow(#Win_0, #PB_Ignore, #PB_Ignore,#PB_Ignore,i)
Delay(2)
Next i
EndIf
EndProcedure
Procedure Win_0()
If OpenWindow(#Win_0,0,0,500,136,"Prova thread",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
ButtonGadget(#Btn_0,230,100,20,15,"Srotola")
EndIf
EndProcedure
Win_0()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case #Btn_0
srot = srot ! 1
CreateThread(@Anim_Win(), srot)
;Anim_Win(srot)
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow