Intuition will refresh a gadget whenever an operation has damaged the layer of the window or requester to which it is attached. Because of this, the typical application does not need to call refreshglist() as a part of its idcmp_refreshwindow event handling. Intuition's refreshing of the gadgets of a damaged layer is done through the layer's damage list. This means that rendering is clipped or limited to the layer's damage region--that part of the window or requester that needs refreshing. Intuition directly calls the layers library functions beginupdate() and endupdate(), so that rendering is restricted to the proper area. Applications should not directly call these functions under Intuition, instead, use the beginrefresh() and endrefresh() calls. calls to refreshglist() or refreshgadgets() between beginrefresh() and endrefresh() are not permitted. Never add or remove gadgets between the BeginRefresh() and EndRefresh() calls. For more information on beginrefresh() and endrefresh(), see the "intuition windows" chapter and the amiga rom kernel reference manual: Includes and Autodocs. Gadgets which are positioned using gflg_relbottom or gflg_relright, or sized using gflg_relwidth or gflg_relheight pose a problem for this scheme. When the window is sized, the images for these gadgets must change, even though they are not necessarily in the damage region. Therefore, Intuition must add the original and new visual regions for such relative gadgets to the damage region before refreshing the gadgets. The result of this is that applications should ensure that any gadgets with relative position or size do not have border, image or intuitext imagery that extends beyond their select boxes.