Thank you for your suggestion to set all closeflags to .FALSE. I have now set the closeflag of all windows (parent and childs) to 'closeflag=.FALSE.. However, setting the closeflag to .FALSE. is not preventing the parent and child windows of Appgraphics from closing when the 'X' is selected. I've only been successful in inactivating the 'X' when setwindowsystemclosecallback is used. Clearly, I must be doing something wrong, but till now I've not been able to identify the problem. Although this not a big problem and the setwindowsystemclosecallback fixes it, I will continue to explore why closeflags set to .FALSE. do not prevent my windows from closing.
The following is the code I used to inactivate the windows 'X' (This approach works perfectly.).
!--- Get main window that signalled the child window
idActiveWin = getsignallingwindow()
!--- Create AppGraphics plot window
!--- function initwindow (width, height, title, left, top, dbflag, closeflag)
myscreen2 = initwindow(510, 440, 'Plot Data', closeflag=.FALSE.)
!--- Set font style to Sans Serif
call settextstyle (SANS_SERIF_FONT, HORIZ_DIR, 14)
!--- TURN OFF THE CLOSEFLAG 'X' IN THE CHILD WINDOW
!--- Sets a callback procedure to be called when the
!--- user clicks the “X” (close button) in the upper corner
!--- on a window or selects “Close” in the window’s system
!--- menu. The callback should be a simple function that
!--- returns 0 if the window is to be kept open, or 1 if
!--- the window should close.
!--- The callback is IGNORED if the window was created with
!--- closeflag set to TRUE in the initwindow call'
!--- When the Initwindow closeflag=.TRUE.and the call to
!--- setwindowsystemclosecallback 'closeflag-active', the user
!--- is asked 'Yes/No' whether to terminate the entire program.
!---call setwindowsystemclosecallback (closeflag_active)
CALL setwindowsystemclosecallback (closeflag_cancel)
I'm sure you'll let me know if you have any further suggestions; otherwise I'll keep exploring.