home *** CD-ROM | disk | FTP | other *** search
- Path: speedy.grolier.fr!usenet
- From: septh@club-internet.fr (Stephan Schreiber)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Q: Finding ASL Window ptr
- Date: 9 Apr 1996 22:14:04 GMT
- Organization: Grolier Interactive Europe
- Message-ID: <4632.6671T187T2660@club-internet.fr>
- References: <4k5th5$4tt@ousrvr3.oulu.fi>
- NNTP-Posting-Host: ppp-98-56.neuilly.club-internet.fr
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
-
- On 06-Avr-96 15:02:13, Timo Karjalainen said about Q: Finding ASL Window
- ptr:
- > Some time ago I wondered how to get an ASL requester closed
- > without user intervention. One proposed solution was to send
- > the ASL requester window a fake IntuiMessage IDCMP_CLOSEWINDOW.
-
- I'm afraid there's no solution to close an open ASL window. Dot.
-
- > Now: How do I find this Window, and thus its UserPort? I'll need
- > that in order to put a Message there. :-D
-
- > It would be most convenient if the ASL structure had a field in
- > it that would contain the address of the Window. This is, however,
- > not the case. (Well, its really ASL private information, but hey, I
- > *need* to get that thing closed somehow!)
-
- > My program runs on a private screen. I know the addresses of all
- > open windows that are my own. Do I just have to step through the screen's
- > Window list and send a faked IDCMP_CLOSEWINDOW to all windows whose
- > address I do not have in the list of "known windows"? Is this even
- > legal? struct Screen has a documented Window ptr and struct Window has
- > a documented next Window ptr.
-
- One better solution would be to spawn a separate process for each ASL
- requester that you open. This is what I do for EasyRequest(), and this allows
- me to have a "normal" EasyRequester (that is, no need to call
- BuildEasyRequest() and SysReqHandler()) while still processing input in other
- windows. If you like, I can send you some source code (in C, of course).
- On the other hand, just looking at the imsg->IDCMPWindow pointer in your
- ASLFR_IntuiMsgFunc hook might be enough to decide if the IntuiMessage applies
- to one of your windows or not. If not, then it must be for the ASL window.
-
- > Hey, Amiga Tech, if you're reading this: I hope you'll fix the VERY BROKEN
- > ASL feature of IntuiMessage callbacks. For a program to do one-task
- > multiwindowing with more than one window handling user input at a time,
- > it really needs to do asynchronous ASL requesters! However, AslRequest()
- > only returns after the user is finished with the requester. If the only
- > way to process user input while in AslRequest() is to use the shared IDCMP
- > & callback feature, there must be a way to close an open ASL requester!
- > I really suggest you add to asl.library a function CloseAslRequest(), which
- > would take the address of an ASL requester structure and close the requester
- > if it was open.
-
- > A better solution would be an AsynchAslRequest(). It would open and set
- > up the requester window and *return immediately*. Once the program notices
- > an IDCMP message that is for an ASL requester, it would pass the message
- > to an asl.library function that would process it. This function would return
- > NULL if the IDCMP event didn't lead to closing the requester, otherwise
- > it would return the address of the ASL requester structure.
-
- Agree with you: a OpenAslRequest()/CloseAslRequest() pair would be ideal,
- along with a ProcessAslEvents() (or something similar, names are not that
- important here).
-
- > In fact it would be best to have a CloseAslRequest() as well, and also
- > something to ReopenAslRequest(). Sometimes a program needs to close the
- > ASL requester while it for example closes the screen and reopens it in
- > another display mode. Reopening would bring the requester back just like
- > it was never closed, except that it would take into account possible
- > changes in the screen, like another font and adjusting requester size
- > or position if the screen has become smaller.
-
- This should simply be built into the AslRequest() function, since it is
- supposed to re-use the same AslRequester structure from call to call. A simple
- screen size checking should be sufficient here.
-
- > Additions like these are *necessary* for Amiga applications to be
- > consistently what Amiga is best known for: multitasking. With these
- > things done, Amiga applications could maintain full "internal multitasking"
- > capabilities and intuitiveness. Didn't the Style Guide say that quitting
- > a program should be possible at all times and that the user should be
- > given all power to do anything?áWell, ASL makes those things impossible.
-
- > I think I'm not the only one who *just hates* file or other requesters that
- > disable them from doing anything else. Sometimes you *need* to able to do
- > something else while the requester is open. Once you can do a little
- > something, you'd expect you can do *anything* - also things like quitting
- > the program or changing (closing!) the screen on which the requester has
- > been opened. It's a matter of user-friendliness. It isn't very fun to chase
- > down every single requester window on a crowded screen.
-
- > tikarjal
-
-