The refreshglist() function was designed to draw gadgets from scratch, and assumes that the underlying area is blank. This function cannot be used blindly to update gadget imagery. The typical problem that arises is that the application cannot change a gadget from selected to unselected state (or from disabled to enabled state) and have the imagery appear correct. However, with a little care, the desired results can be obtained. Depending on the imagery you select for your gadget, the rendering of one state may not completely overwrite the rendering of a previous one. For example, consider a button which consists of a complement-highlighted boolean gadget, whose imagery is a surrounding border and whose label is an intuitext. attempting to visually unselect such a gadget by clearing its gflg_selected flag and refreshing it will leave incorrect imagery because refreshglist() just redraws the border and text, and never knows to erase the field area around the text and inside the gadget. That area will remain complemented from before. One solution is to use a gadget whose imagery is certain to overwrite any imagery left over from a different state. Disabling a gadget or highlighting it with complement mode affects the imagery in the entire select box. To overwrite this successfully, the gadget's imagery (gadgetrender) should be an image structure which fully covers the select box. Such a gadget may be highlighted with color complementing (gflg_gadghcomp), or with an alternate image (gflg_gadghimage) for its selectrender. or, for a gadget which will never be disabled but needs to be deselected programmatically, you may also use a border structure for its GadgetRender, and an identically-shaped (but differently colored) Border for its SelectRender. The other technique is to pre-clear the underlying area before re-rendering the gadget. To do this, remove the gadget, erase the rectangle of the gadget's select area, change the gflg_selected or the gflg_disabled flag, add the gadget back, and refresh it. If the gadget has a relative size and/or position (i.e., if of the GFLG_RELxxx flags are used), then the application will need to compute the rectangle of the gadget's select area based on the window's current width and/or height. Since the window size is involved in the calculation, it is important that the window not change size between the call to removeglist() and the call to rectfill(). to ensure this, the application should set idcmp_sizeverify so that intuition will first notify you before beginning a sizing operation. (Note that applications using any of the IDCMP verify events such as IDCMP_SIZEVERIFY should not delay long in processing such events, since that holds up the user, and also Intuition may give up and stop waiting for you).