Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!ukma!nrl-cmf!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!hpindda!grant From: grant@hpindda.HP.COM (Grant Haidinyak) Newsgroups: comp.sys.amiga Subject: Burning Questions Message-ID: <6570001@hpindda.HP.COM> Date: Tue, 24-Nov-87 02:42:13 EST Article-I.D.: hpindda.6570001 Posted: Tue Nov 24 02:42:13 1987 Date-Received: Sat, 28-Nov-87 01:35:52 EST Organization: Hewlett Packard, Cupertino Lines: 76 Hello, I seem to be having trouble with requesters. The problem is that I have a requester with a PREDRAWN image, and one boolean gadget. To acivate the requester, I use the InitRequester, and setup the requester stucture as follows: InitRequester(rqstr); rqstr->LeftEdge = 160; rqstr->TopEdge = 50; rqstr->Width = log_rqstr_image.Width; rqstr->Height = log_rqstr_image.Height; rqstr->RelLeft = 0; rqstr->RelTop = 0; rqstr->ReqGadget = &log_rqstr_gadget; rqstr->ReqBorder = NULL; rqstr->ReqText = NULL; rqstr->Flags = PREDRAWN; rqstr->BackFill = 1; rqstr->ImageBMap = log_rqstr_bitmap; and to render the requester I do the following: Request(&log_rqstr, win_main); where win_main is a pointer to the window that I am trying to render the requester in. What happens is that after the call to Request, nothing is displayed, however, after I double click on the window, the requester is rendered, and everything works fine from then on. My Question is: What am I doing wrong? Also, I'm writing a program that has multiple windows being opened, that are attached to one port. The problem that I have found with this is: 1) A Close request for a window comes in. 2) I Close the window, the messages associated with this window get deallocated. 3) There are still pending messages for the window queued to the port. 4) I start to process the queueed messages. 5) Guru because of bad next link pointer (memory had been deallocated). I have come up with 2 solutions to this problem. 1) When I close the window, do the following: a) Forbid b) Go through the list of messages queued to the port, and if the message is for the Closing window the remove it from the queue, and reply to the message. c) Permit 2) Maintain a second queue of messages, and a second series of procedures that get and put messages associated with the port, i.e. my_get_msg - would first check the secondary queue for messages, and if none were available, then do a normal GetMsg(). my_put_msg - would put a message on the secondary queue. Then when a window was to be closed, the following would occur: a) while (GetMsg() != NULL) { if (msg is for window) Reply() else my_put_msg() } There are good points, and bad points associated with each method, but I'd like to know which is accepted, or if there is a standard way of doing this already. Thanks, Grant