Try Release a Child Window :
Code: Select all
/*
* HMG This Demo
* (c) 2003 Roberto Lopez
*/
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'This Demo' ;
MAIN ;
ON INIT ThisWindow.Title := 'New Title'
@ 10,10 BUTTON Button_1 ;
CAPTION 'Hi!!!' ;
ACTION ThisTest() ;
TOOLTIP 'Test Tip'
@ 40,10 BUTTON Button_2 ;
CAPTION 'Release' ;
ACTION ThisWindow.Release
@ 70,10 BUTTON Button_3 ;
CAPTION 'New Window' ;
ACTION NewWindow() ;
TOOLTIP 'Create New Window'
@ 100,10 BUTTON Button_4 ;
CAPTION 'Release New Window' ;
WIDTH 200 ;
ACTION ReleaseNewWindow()
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
FUNCTION ReleaseNewWindow()
IF IsWindowDefined( "NewWindow")
msgDebug( "before")
DoMethod( "NewWindow", "Release")
msgDebug( "after")
ELSE
MsgInfo( "Click New Window!")
ENDIF
RETURN NIL
FUNCTION NewWindow()
DEFINE WINDOW NewWindow ;
AT 20,20 ;
WIDTH 400 ;
HEIGHT 300 ;
CHILD ;
TITLE 'New Window'
END WINDOW
ACTIVATE WINDOW NewWindow
RETURN NIL
Procedure ThisTest()
This.Caption := 'New Caption'
ThisWindow.Row := 10
ThisWindow.Col := 10
ThisWindow.Width := 200
ThisWindow.Height := 100
Return
TIA
best rgds,
Chang