🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10837

Re: Two programs using same window?

#10837
From: Larry Phillips
Date: Thu, 05 Jan 1989 14:45
42 lines
2379 bytes
In <5715@sdcsvax.UUCP>, bruss@odin.ucsd.edu (Brian Russ) writes:
> 	Here's what I want to do.  Program X starts up, opens a 
> custom screen and perhaps a window, and then Execute()'s another
> program Y.  I wish for Y to write into the window opened by X
> (or, alternatively, Y can open a window and attach it to X's screen
> and "inherit" (for want of a better term) X's screen's info).
>	Is this possible?  Can Y find X's screen/window and use it?

  Yes, it's possible. One method is to simply have program X pass the window
address to program Y via a message, but ...

> Is it dangerous?  I suppose I could have Y open it's own screen but

... remember, you are accessing a common resource. If program X has
responsibility for closing the window, you must make sure that program Y does
not attempt to use it after program X closes it. Program X must not close the
window unless it is sure that program Y is not going to try to acccess it
again. Be especially careful of abnormal exits on the part of either program.
This is an area that is often overlooked, the abnormally exiting program
failing to properly check for some necessary condition, of failing to notify
the other program of the situation. You can use bidirectional messaging to
synchronize all aspects of operation, and perhaps semaphores will do it (not
familiar with semaphore usage).

> I prefer it this way ... oh, I'm using Manx C if that's any help.

  It doesn't matter. The underlying principle is the same in all languages.

>	Apologies if this isn't techie enough for .tech.

Looks OK to me.

-larry

--
Frisbeetarianism: The belief that when you die, your soul goes up on
                  the roof and gets stuck.
+----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                |
| \X/    lphillips@lpami.wimsey.bc.ca or uunet!van-bc!lpami!lphillips  |
|        COMPUSERVE: 76703,4322                                        |
+----------------------------------------------------------------------+
Technical Details
Message-ID: <2104@van-bc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!van-bc!root

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!van-bc!root
From: lphillips@lpami.wimsey.bc.ca (Larry Phillips)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Two programs using same window?
Message-ID: <2104@van-bc.UUCP>
Date: 5 Jan 89 14:45:38 GMT
Sender: root@van-bc.UUCP
Lines: 42