Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!zaphod.mps.ohio-state.edu!rpi!leah!wfh58 From: wfh58@leah.Albany.Edu (William F. Hammond) Newsgroups: comp.sys.amiga.tech Subject: Re: Ptr to top screen Summary: Is it "legal" to open a window there? Message-ID: <2846@leah.Albany.Edu> Date: 8 Apr 90 00:08:30 GMT References: <170009@hplsla.HP.COM> <706@mpirbn.UUCP> Reply-To: wfh58@leah.albany.edu.UUCP (William F. Hammond) Organization: Dept of Math & Stat, SUNYA, Albany, NY Lines: 33 In article <706@mpirbn.UUCP> p554mve@mpirbn.UUCP (Michael van Elst) writes: >In article <170009@hplsla.HP.COM> davidb@hplsla.HP.COM (David Bakeman) writes: >>I hope this is a simple question! Is there a "legal" way to get a pointer >>to the current top screen? In other words if I have a workbench screen and >>a couple of custom screens is there a way to get a pointer to one of the >>custom screens when it is the top screen? > >There is a legal way, but there aren't many legal operations you could do >with this screen (unless you have opened the screen yourself). > . . . One of the things I might want to do on someone else's screen is open a window for my application. For example, I (the user) often run "VLT" under its custom screen option. Sometimes, I "need" to have a memory monitor available there. So I hacked one up that opens up a little "strip" window (just high enough to have borders and one line of text and long enough to have close, front/back, and drag gadgets plus ten or so characters of text) *on the ACTIVE screen*. I LockIBase long enough to grab the pointer, determine basic screen parameters, and open my window; then I release the lock. I do wonder about the "legality" of this. One obvious problem is that the screen owner (usually at the behest of the user) may close the screen while the "foreign" window is still open. In the particular instance I have just cited this fortunately does not lead to big fireworks but only to a certain waste of memory and cpu since I did not attempt to make provision in the code for that possibility. Turning the legality question around a little bit: Why should the programmer assume that the user always wants windows that are not intended for a screen belonging to the program to go on the WorkBench Screen? -- Bill ---------------------------------------------------------------------- William F. Hammond Dept. of Mathematics & Statistics 518-442-4625 SUNYA, Albany, NY 12222 wfh58@leah.albany.edu wfh58@albnyvms.bitnet ----------------------------------------------------------------------