Path: utzoo!attcan!uunet!modcomp!kevin From: kevin@modcomp.UUCP (Kevin Smith) Newsgroups: comp.sys.amiga Subject: Re: Activating Gadgets in C Message-ID: <325@modcomp.UUCP> Date: 3 Aug 90 12:37:41 GMT References: <2384@ryn.esg.dec.com> <13581@cbmvax.commodore.com> Lines: 43 peter@cbmvax.commodore.com (Peter Cherna) writes: >In article <2384@ryn.esg.dec.com> barrett@meridn.enet.dec.com (Keith Barrett) writes: >>I need help with gadgets in C. I created a database that uses string gadgets >>as input. The problem is I can't get the gadgets to auto-activate so that you >>don't have to click the mouse on the string gadget to activate it. >Two of my colleagues already mentioned the ActivateGadget() function that >was added to Intuition in 1.2. If you do any significant work with gadgets >you should buy a copy of the 1.3 Libraries and Devices volume of the >ROM Kernal Manual, and get the 1.3 Includes and Autodocs book or order >the disk-version from CATS. There are a number of gadget functions >added in 1.2 that are not documented in the 1.1 RKMs. The 1.1 volumes >are white with a colored stripe. The 1.3 editions are blue. >As well, if you intend to activate the first gadget when your window opens, >you should know that you should wait for the ACTIVEWINDOW IntuiMessage >before activating your gadget. This is because a lot of Intuition work >happens asynchronously to your task, so when you call > OpenWindow(...); > ActivateGadget(...); >the window may not yet be open or active when ActivateGadget() is called. I was hoping somebody someone from C= was going to give the real problem and solution about waiting for ACTIVEWINDOW. I have seen this question asked and answered before and am wondering if this bit about waiting for ACTIVEWINDOW is documented anywhere, like in the new RKM's or any other book. When I upgraded to 1.2 I was excited to have new gadget functions but when I used ActivateGadget it still didn't work since I wasn't waiting for ACTIVEWINDOW. I must of cussed at this problem for two weeks before somebody gave me a working solution. Actually I had this problem when popping up a requester with gadgets in it and the string gadget would never activate. The solution I got and still use today is to open up the requester then use a Delay() of a couple seconds and then do an ActivateGadget(). Kevin Smith uunet!modcomp!kevin