GUI: nest a frame inside another one

trantor

New Member
Hi
I have one main program (.w), and several child programs (.w just interface with some functionality).
Have a place in the main one, where I want to put the frames from the child pages.
For example, when we have some menu on the left (nodes), and we want on every click on the node to change the view on the right.

Any idea how can I inplement this?
 
Yes, it's easy to implement. For the child programs (I suppose they use the window widget) you should turn on 'Supress window' flag in window properties. After that you can run the child programs from the main window and their frames will be put in it.
HTH
 
One more question, once I have the child window nested in the main prog, how is possible to remove it from there?
 
It depends on which window have to close a child window. If a child window have to close itself you should add the following code in its 'close' button trigger:

Code:
APPLY "CLOSE" TO THIS-PROCEDURE.
RETURN NO-APPLY.

If the main window have to close a child window you should add the following code in a trigger of the main window:

Code:
APPLY "WINDOW-CLOSE" TO CURRENT-WINDOW.
RETURN NO-APPLY.

HTH
 
That's perfect!
But the child window became current, and it reacts on the close button up there, I mean that if the user try to close the program, he close the current window and the program is still alive.
I can handle this by some close procedure, but is it possible to set something in the child and to omit this?
And the last question - not to put the child to appear in some different position - not in 0,0?
 
I can handle this by some close procedure, but is it possible to set something in the child and to omit this?

It might be tricky. You should add the following code in the WINDOW-CLOSE trigger of a child window. It's just a sample, use it as an example.

Code:
/* Use LAST-EVENT handle to detect the event source */
IF  LAST-EVENT:FUNCTION = "WINDOW-CLOSE" THEN QUIT.

And the last question - not to put the child to appear in some different position - not in 0,0?

It's a piece of cake. Add the following code in the main block of a child window

Code:
FRAME <child frame name>:X = 0.
FRAME <child frame name>:Y = 0.
 
Back
Top