In this section:
%aw (Attach MDI Child Window) attaches the window as an MDI child of a parent. The parent must contain an MDI frame (%fr (MDI Frame)). %aw takes an INTEGER argument that is a control variable attached to the parent window (the parent must already exist). If the parent window does not use %lw (Leave Window Open), and therefore does not have a control variable, use %cv (Control Variable) in the parent window. In general the child window should have a caption so that it can be moved, maximised, minimised, etc. within the frame. This means that you should not use the %ww (Window Style) no_caption option in this context.
The following code provides the basis of a simple "multipad" editor using %fr (MDI Frame) and %aw (Attach MDI Child Window).
WINAPP
INTEGER ctrl,winio@
EXTERNAL open_func
CHARACTER*128 fname
COMMON ctrl
fname='*.for'
i=winio@('%ww[no_border]&')
i=winio@('%mn[&File[&Open]]&',
+ 'FILE_OPENR[Open]',fname,'+',open_func,'EDIT_FILE',fname)
i=winio@('%mn[[E&xit]]&','EXIT')
i=winio@('%pv%fr&',400L,300L)
i=winio@('%lw',ctrl)
END
INTEGER FUNCTION open_func()
COMMON ctrl
INTEGER ctrl,winio@
i=winio@('%pv%aw&',ctrl)
i=winio@('%20.8eb[no_border]','*',0L)
open_func=1
END
Details of the standard call-back functions FILE_OPENR, +, EDIT_FILE, and EXIT are given in Standard call-back functions.