How to close child window when Parent close - using Publish and Subscribe

Hi,

Can anyone help me for the following.

I have a window x.w and a button which calls y.w persistently. When x.w close, I need to close the child y.w.

Please tell me , how is it possible using Publish and Subcribe functions? Help me with some code snippet.
TIA
Regards
Philip
 
Why do you want to publish etc? Why not get a handle to y.w when you run it and

RUN CloseProcedure in lv-Handle.
 
Obtaining handles and then keeping track of them is a pain in the buttocks.

I much prefer to fire off a persistent procedure and then talk to it via PUB/SUB without any silly handles cluttering up the scenery.

It is easy to do what the OP asks; y.w needs to have something like:

Code:
/* y.w
 */

/* blah, blah, blah... */

procedure goAwayNow:
  /* do whatever you need to do to close the window... */
end.

subscribe to "goAway" anywhere run-procedure goAwayNow.

return.

Then in x.w just say:

Code:
publish "goAway".
 
Fair enough, Tom. I've always used handles for stuff like that and have been finding pub/sub rather clunky! lol
 
Back
Top