Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!crash!pnet01!billk From: billk@pnet01.cts.com (Bill W. Kelly) Newsgroups: comp.sys.amiga.tech Subject: Re: Ghosting of Boolean Gadgets Message-ID: <3699@crash.cts.com> Date: 13 Jan 89 11:37:54 GMT Sender: news@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 65 Chuck McManis was saying: >... The easiest way to make those gadgets work is >to Alloc a little bitmap, render your text and border into it, and then >build a gadget out of it that is an Image gadget (which it turns out is >really the simplest gadget). Then things will work as you expect except >that you will probably get a lot of "flashing" when you refresh your >... I have a way of doing it that accomplishes the same thing without having to allocate CHIP RAM for Image data and render the text and border into it. I use two linked image structures and NO image data. I also use the gg_GadgetText field to do the text. 1111111111111111111111111 1 1 1 2222222222222222222 1 1 2 2 1 1 2 GadgetText 2 1 1 2 2 1 1 2222222222222222222 1 1 1 1111111111111111111111111 The ones represent the rectangle covered by the first image. The twos represent the rectangle covered by the second image. The second image is linked to the first image through the first image's ig_NextImage pointer. I use the ig_PlaneOnOff bits to pick the color I want each image to be drawn with. Suppose I set the first (outer) image so that it will produce a big black rectangle when drawn, and the second (inner) image so that it will produce a big white rectangle a few pixels smaller than the black rectangle. Now you've got a white gadget (the big white rectangle) surrounded by a black border (what's left of the black rectangle). Finally, Intuition will render the GadgetText. Interestingly enough, this method hardly "flashes" at all! I use it quite often and for some very *BIG* gadgets (2 bitplane screen). The only detectable flashes are on the largest gadget (about 500 pixels wide by 40 pixels high). Another effect that I get out of this is to make another set of image structures that I put in the gg_SelectRender field. I make the SelectRender images smaller than the normal images so that when you click on the gadget, it animates. (The "border" shrinks in towards the gadget text.) Even animating the images that way hardly causes any "flashing." (Blitters are wonderful, aren't they?) By the way, it's possible I may have meant ig_PlanePick instead of ig_PlaneOnOff. I don't remember. Whatever it's name is, it's the one that selects image planes that will be turned on or off (probably PlaneOnOff, huh? :-) without having to have any image data for said planes. This method seems to work quite well for me. -- NAME: Bill W. Kelly UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!billk ARPA: crash!pnet01!billk@nosc.mil INET: billk@pnet01.cts.com "main() {printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}" -- David Korn, AT&T Bell Labs