Path: utzoo!utgpu!water!watmath!clyde!att!mtuxo!tas From: tas@mtuxo.att.com (XMPC2-T.SKROBALA) Newsgroups: comp.sys.amiga.tech Subject: Re: Unselecting gadgets under program control Summary: RemoveGadget/AddGadget Message-ID: <2939@mtuxo.att.com> Date: 1 Oct 88 22:31:42 GMT References: <3141@pt.cs.cmu.edu> Organization: AT&T, Middletown NJ Lines: 21 > > How do I unselect a TOGGLESELECT gadget under program control? > > Reseting the SELECTED and refreshing the gadgets causes my machine > to crash and burn. I've bypassed the problem by rendering the gadget imagery > myself, but this is a lot of work I don't think that I should have had to go > to. > Try long i ; i = RemoveGadget( window, gadget ) ; gadget.Flags &= ~SELECTED ; AddGadget( window, gadget, i ) ; /* (Or AddGList(...)) */ I think you'll thus be able to get away without doing rendering on your own (but I'm not sure if the selected/deselected images are of different sizes: at worst you'll have to clear an area the size of the larger image before you call AddGadget()). Tom Skrobala AT&T Bell Laboratories mtuxo!tas