Setting up Parent-Child Windows

Kladkul

Member
Hello, first off let me introduce myself. I recently graduated college and started working for a company that uses OE10. So far I like the language although I have to admit it is hard finding information on the web about the language (used to .NET and MSDN :p).

Anyway, I am working with a window that calls another window. I need the called window to have focus and also close if the calling window is closed. I'd prefer to do all of this from the calling window so that I do not have to alter the called window. Is there a way to do this? I've been reading bout parent-child windows and that seems that may be the key here.

Thanks in advance.
 

RKR

Member
There is a trigger "parent-window-close" that should fire when the parent window is closed. This trigger should be used in the child window and there you can put logic that will close your window.
 

Kladkul

Member
How exactly do I make it the child? The would-be child can be called from several different programs.

Also, is there a way to do this from the calling (would-be parent) program? This would really cut down on the time it would take if I can do it from the calling program.

Thanks again.
 

RKR

Member
How exactly do I make it the child? The would-be child can be called from several different programs.

Also, is there a way to do this from the calling (would-be parent) program? This would really cut down on the time it would take if I can do it from the calling program.

Thanks again.


It is even more simpler ;-) You can run the child window from the parent window.

RUN <childwindowname> PERSISTENT SET <ProcedureHandle>.

Childwindowname should be replaced by the name of your childwindow. The filename of the procedure. for instance window2.w

ProcedureHandle is a variable of type handle.

When you do this the child window will automatically be parented to caller. When closing the caller the child will automatically close. No need for extra coding.
 

Kladkul

Member
Thanks for your help. That worked but it worked in combination with a few other additions. Here's what I added.

Code:
APPLY "ENTRY":U TO [object in child window].

I had to edit the child window after all but it does work now.
 
Top