Page 1 of 1

macOS M2 / Apple Silicon - Threading Freeze with EditorGadget

Posted: Wed Sep 24, 2025 4:29 am
by skinkairewalker
I've tested this exact code on an M2 Mac (macOS), and the application just freezes without populating the EditorGadget. However, it works perfectly on Linux ARM and Windows x64. Can anyone else confirm this behavior?

Code: Select all


Enumeration
  #Window_Main
  #Editor_Log
EndEnumeration


Procedure PopulateEditor(Gadget)
  Protected i
  For i = 1 To 100000

    AddGadgetItem(#Editor_Log, -1, "Esta é a string de número: " + Str(i))
  Next i
EndProcedure


If OpenWindow(#Window_Main, 0, 0, 600, 400, "Populando EditorGadget com Thread", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)


  EditorGadget(#Editor_Log, 0, 0, WindowWidth(#Window_Main), WindowHeight(#Window_Main))


  CreateThread(@PopulateEditor(), GadgetID(#Editor_Log))

  Repeat
    Define Event = WaitWindowEvent()

    Select Event

      Case #PB_Event_CloseWindow
        Break
    EndSelect
  ForEver

EndIf

Re: macOS M2 / Apple Silicon - Threading Freeze with EditorGadget

Posted: Wed Sep 24, 2025 6:37 am
by Bisonte
Is it not the same like in Windows ?
Don't manipulate gadgets from another thread as the mainthread ?

Re: macOS M2 / Apple Silicon - Threading Freeze with EditorGadget

Posted: Wed Sep 24, 2025 8:22 am
by Fred
Yes you can't do that, you need to use PostEvent()

Re: macOS M2 / Apple Silicon - Threading Freeze with EditorGadget

Posted: Wed Sep 24, 2025 8:33 am
by mk-soft
It only worked for you on Linux by chance.
Here, too, no gadgets from threads should be changed.

See Mini Thread Control to change gadgets on threads.

Re: macOS M2 / Apple Silicon - Threading Freeze with EditorGadget

Posted: Wed Sep 24, 2025 1:39 pm
by skinkairewalker
oooooh, awesome

Re: macOS M2 / Apple Silicon - Threading Freeze with EditorGadget

Posted: Wed Sep 24, 2025 2:56 pm
by Piero
See why I'm long-time mk-soft Fan?