Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!axion!cat.fulcrum.bt.co.uk!sie From: sie@fulcrum.bt.co.uk (Simon Raybould) Newsgroups: comp.sys.amiga Subject: Gadgets Message-ID: <1989Dec20.100023.6376@cat.fulcrum.bt.co.uk> Date: 20 Dec 89 10:00:23 GMT Reply-To: sie@fulcrum.bt.co.uk (Simon Raybould) Organization: BT Fulcrum, Birmingham, England Lines: 43 I am trying to make two boolean gadgets mutually exclusive of each other The code below works ish. When the first gadget is selected, it is highlighted. When the second gadget is selected, it is highlighted and the first should be un-highlighted as a toggle where one or the other is highlighted, but not both. At the moment, the second click on a gadget cause it to change its colours. Any help on this would be apreciated. I believe that to do this, the gadgets have to be removed, altered and then re-added to the window, is this true? The code below is taken from a program and is from the code for handling the GADGETUP message. PURCHASE and REPAY are both gadget structures. } else if(Message->IAddress == (APTR)&REPAY) { PR = PR_REPAY; ip = RemoveGadget(AddWindow, &PURCHASE); ir = RemoveGadget(AddWindow, &REPAY); REPAY.Flags |= SELECTED; PURCHASE.Flags &= ~SELECTED; AddGadget(AddWindow, &PURCHASE, ip); AddGadget(AddWindow, &REPAY, ir); RefreshGadgets(&REPAY, AddWindow, NULL); } else if(Message->IAddress == (APTR)&PURCHASE) { PR = PR_PURCHASE; ir = RemoveGadget(AddWindow, &REPAY); ip = RemoveGadget(AddWindow, &PURCHASE); PURCHASE.Flags |= SELECTED; REPAY.Flags &= ~SELECTED; AddGadget(AddWindow, &REPAY, ir); AddGadget(AddWindow, &PURCHASE, ip); RefreshGadgets(&REPAY, AddWindow, NULL); } many thanks. S.J.R +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+-=-=-=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Simon Raybould | BT Fulcrum | Are all your pets called | | path : sie@fulcrum.bt.co.uk | Birmingham | Eric ??? - Python | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+-=-=-=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=-=-=-+