home *** CD-ROM | disk | FTP | other *** search
- Path: hearst.acc.Virginia.EDU!adastra!mbs
- Newsgroups: comp.sys.amiga.programmer
- From: mbs@adastra.cvl.va.us (Michael B. Smith)
- Subject: Re: Strange bug in window blocking Request() - comments please
- References: <dave.0bmt@ccom.co.nz>
- X-NewsReader: GRn 3.1 March 23, 1996
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Message-ID: <mbs.4apz@adastra.cvl.va.us>
- Date: Mon, 1 Apr 96 06:53:54 EDT
- Organization: Only if you insist...
-
- In article <dave.0bmt@ccom.co.nz> dave@ccom.co.nz (David Eaves) writes:
- > elimination I think I have tracked it to the way in which I was using an
- > invisible requester to block window input. Here is the original code:
- >
- > InitRequester(req);
- > req->LeftEdge = req->TopEdge = -1;
- > req->Width = req->Height = 1;
- > req->Flags = SIMPLEREQ | NOREQBACKFILL;
- > Request(req, window);
- >
- > I am not sure where I got this piece of code from (I think I copied it
- > from someone else's source), but after reading up the RKM's and autodocs
- > it seems more correct to do just:
- >
- > InitRequester(req);
- > Request(req, window);
-
- You may not remember, but in the very early 2.0 days, we had a
- huge flame war over this. :) Anyway, the guys at C= said this
- was the way to do it (and this is the way GRn/GMail/etc. do it
- and they run on everything from 2.04 up):
-
- struct Requester disable_req = {
- 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- int
- windowDisableCount;
- struct Window
- *mainWindow;
- ...
-
- __inline void
- DisableWindow (void)
- {
- if (!windowDisableCount)
- Request (&disable_req, mainWindow);
- ++windowDisableCount;
- return;
- }
-
- __inline void
- EnableWindow (void)
- {
- if (windowDisableCount)
- {
- if (!(--windowDisableCount))
- EndRequest(&disable_req, mainWindow);
- }
- return;
- }
-
- --
- // Michael B. Smith
- \X/ mbs@adastra.cvl.va.us
-