Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.programmer Subject: Re: Problem with gadget refresh. Message-ID: <22667@cbmvax.commodore.com> Date: 24 Jun 91 22:07:12 GMT References: <11251@castle.ed.ac.uk> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore-Amiga, Inc. West Chester, PA. Lines: 41 In article <11251@castle.ed.ac.uk> mfg@castle.ed.ac.uk (M Gordon) writes: >I'm currently writing a program in which I need to disable and later >re-enable some gadgets. ... The problem appears when I >try to re-enable them, using the same method but setting the flags to >flags & ~GADGDISABLED. The gadgets are selectable again but there is >a small part of the pattern that covers them when they are inactive >left around the edges, outside the actual gadget but inside the >border drawn around it. Any ideas as to what I might be doing >wrong? Strangely enough, Intuition knows how to draw dots over a gadget, but it doesn't explicitly know how to erase them. What it does is redraws the gadget over whatever is there (dots in your case). A gadget that is made up of text and borders, or any other imagery that doesn't fully cover the select-box area, will be left with a sprinkling of dots. So one approach is to use GADGIMAGE gadgets whose image covers the entire select area. Alternately, you can physically erase the bits while the gadget is removed, i.e. RemoveGadget(); gad->Flags &= GADGDISABLED; RectFill(win->RPort, gad->LeftEdge, gad->TopEdge, gad->LeftEdge+gad->Width-1, gad->TopEdge+gad->Height-1); AddGadget(); RefreshGadget(); (I left out the details of the Remove/Add/RefreshGadget calling). Of course, if your gadget is GRELWIDTH/HEIGHT/RIGHT/BOTTOM, your calculation for the RectFill() is more complex. >Michael Gordon - mfg@castle.ed.ac.uk OR ee.ed.ac.uk | |_| |_| |__| |_| | Peter -- Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "Gosh, didn't he have anything positive to say at all?"