Page 1 of 1

How can I close all the Thread

Posted: Wed Jul 31, 2019 10:16 am
by digitsoft
Hello Roger
How can I close all the Thread that are created to the windows that are open

Re: How can I close all the Thread

Posted: Wed Jul 31, 2019 11:00 am
by rdonnay

Code: Select all

FUNCTION CloseAllWindows()

LOCAL aChildList, i

aChildList := MainWindow():drawingArea:childList()

FOR i := 1 TO Len(aChildList)
  PostAppEvent(xbeP_Close,,,aChildList[i])
  Sleep(50)
NEXT

RETURN nil

Re: How can I close all the Thread

Posted: Wed Jul 31, 2019 1:36 pm
by digitsoft
Roger this function MainWindow () does not exist


rdonnay wrote:

Code: Select all

FUNCTION CloseAllWindows()

LOCAL aChildList, i

aChildList := MainWindow():drawingArea:childList()

FOR i := 1 TO Len(aChildList)
  PostAppEvent(xbeP_Close,,,aChildList[i])
  Sleep(50)
NEXT

RETURN nil

Re: How can I close all the Thread

Posted: Wed Jul 31, 2019 1:46 pm
by rdonnay
function MainWindow () does not exist
Do you have a Get-Set function that points to your main dialog window?
Do you know what I mean by this?

Code: Select all

// Main dialog window
DCREAD GUI EVAL {|oDlg|MainWindow(oDlg)}


FUNCTION MainWindow( oDlg )

STATIC soDlg

IF Valtype(oDlg) == 'O'
  soDlg := oDlg
ENDIF

RETURN soDlg

Re: How can I close all the Thread

Posted: Wed Jul 31, 2019 2:09 pm
by digitsoft
Thanks Roger

rdonnay wrote:
function MainWindow () does not exist
Do you have a Get-Set function that points to your main dialog window?
Do you know what I mean by this?

Code: Select all

// Main dialog window
DCREAD GUI EVAL {|oDlg|MainWindow(oDlg)}


FUNCTION MainWindow( oDlg )

STATIC soDlg

IF Valtype(oDlg) == 'O'
  soDlg := oDlg
ENDIF

RETURN soDlg