Life time of a MDI CHILD
Posted: Sun Aug 30, 2020 8:25 am
Hi all,
try this minimal example, why after end of MDICHILD oChild the window is already
active ?
TIA
try this minimal example, why after end of MDICHILD oChild the window is already
active ?
Code: Select all
#include "fivewin.ch"
function Main()
local oWnd, oFont
local aData := { 1, 2, 3, 'Something' }
local nVar := 99, cVar := 'Hello'
local oMenu
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-15
MENU oMenu
MENUITEM "Child" ACTION Child( oWnd )
MENUITEM "Quit" ACTION oWnd:End()
ENDMENU
DEFINE WINDOW oWnd MDI MENU oMenu
oWnd:SetFont( oFont )
oWnd:bRClicked := { || Debug( "oWnd", oWnd ) }
ACTIVATE WINDOW oWnd
RELEASE FONT oFont
return nil
function child( oParent )
local oChild
local oFont
local aData := { 1, 2, 3, 'Something from child' }
local nVar := 99, cVar := 'Hello from child'
local lExit := .F.
local oLbl01
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-15
DEFINE WINDOW oChild MDICHILD OF oParent
oChild:SetFont( oFont )
oChild:bRClicked := { || Debug( "oChild", oChild ) }
@ 10 , 10 SAY oLbl01 VAR "Codice" OF oChild
ACTIVATE WINDOW oChild VALID ( lExit := .T. , .T. )
STOPUNTIL( { || lExit } )
Debug( "oChild", oChild )
RELEASE FONT oFont
return nil
init procedure Inizio
return
exit procedure Fine
return
*--------------------------------------------------------------------------------
Function Debug( cVar01, uVar01 )
*--------------------------------------------------------------------------------
LOCAL aStack := {}
LOCAL nStack := 1
DEFAULT cVar01 := ""
DEFAULT uVar01 := NIL
DO WHILE .NOT. Empty( ProcName(nStack) )
AAdd( aStack, { ProcLine(nStack), ProcFile(nStack), ProcName(nStack) } )
nStack ++
ENDDO
Xbrowse( aStack, "Stack ",, { |o| o:cHeaders := { "Linea", "File", "Procedura" } } )
XBrowse( ArrTranspose( { { cVar01 } , Eval( { || { uVar01 } } ) } ), ;
ProcName(0) + " : Linea : " + LTrim( Str( ProcLine(0) ) ),, ;
{ |o| o:cHeaders := { "Variabile", "Valore" } } )
RETURN NIL
TIA