[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Intuition' (#aros)


Refresh (redraw) the gadget display.


Source position: intuition.pas line 3224

procedure RefreshGadgets(

  Gadgets: PGadget;

  Window: PWindow;

  Requester: PRequester





A pointer to the first in the list of gadgets wanting refreshment



A pointer to the window containing the gadget or its requester



A pointer to a requester (ignored if gadget is not attached to a requester).


Refreshes (redraws) all of the gadgets in the gadget list starting from the specified gadget.

The window parameter must point to the window which contains the gadget, or which contains the requester that contains the gadget The requester parameter must only be valid if the gadget has the GTYP_REQGADGET flag set, a requirement for all requester gadgets.

The two main reasons why you might want to use this routine are: first, that you've modified the imagery of the gadgets in your display and you want the new imagery to be displayed; secondly, if you think that some graphic operation you just performed trashed the gadgetry of your display, this routine will refresh the imagery for you.

Note that to modify the imagery of a gadget, you must first remove that gadget from the window's gadget list, using RemoveGadget() (or RemoveGList()). After changing the image, border, text (including text for a string gadget), the gadget is replaced in the gadget list (using AddGadget() or AddGList()). Adding gadgets does not cause them to be displayed (refreshed), so this function, or RefreshGList() is typically called.

A common technique is to set or reset the GFLG_SELECTED flag of a Boolean gadget and then call RefreshGadgets() to see it displayed highlighted if and only if GFLG_SELECTED is set. If you wish to do this and be completely proper, you must RemoveGadget(), change the GFLG_SELECTED flag, AddGadget(), and RefreshGadgets(), or the equivalent.

The gadgets argument can be a copy of the FirstGadget variable in the Window structure that you want refreshed: the effect of this will be that all gadgets will be redrawn. However, you can selectively refresh just some of the gadgets by starting the refresh part-way into the list: for instance, redrawing your window non-GTYP_GZZGADGET gadgets only, which you've conveniently grouped at the end of your gadget list.

Even more control is available using the RefreshGList() routine which enables you to refresh a single gadget, or number of your choice.

Note: It's never safe to tinker with the gadget list yourself. Don't supply some gadget list that Intuition hasn't already processed in the usual way.


//Refresh all gadgets of a window
RefreshGadgets(Win^.FirstGadget, Win, nil);

See also



Refresh (redraw) a chosen number of gadgets.



Remove a gadget from a window.



Remove a sublist of gadgets from a window.



Add a gadget to the gadget list of a window.



Add a linked list of gadgets to a window or requester.

Documentation generated on: 2017-01-10