# gRedraw

Definition: | include xpGUI.e gRedraw(gdx id, integer flags=0b111)
Description: | Redraw and/or update the size and layout of all controls in the same dialog. id: Identifier of the interface element. flags: (currently unused, see nores).
pwa/p2js: | Supported.
Notes: | There were five similar routines in pGUI, namely IupRedraw(), IupRefresh(), IupRefreshChildren(), IupUpdate(), and IupUpdateChildren(), and I always ended up experimenting until finding the one (particular combination that) did precisely what I wanted. The flags parameter is, in time, intended to cover these three basic needs: do/don’t bother to recalculate all the sizes and positions. resize (but don’t reposition) just the one field, because it might now have longer text. do it now (if invoked from a busy-loop) or just queue the update. Right now the routine is possibly a little more brutal than it needs to be, and might degrade performance a little bit, especially when updating a single status field several thousand times a second, but I’ll investigate that further if and when it becomes necessary, and not before. [In most cases a simple test on how long since the last update suffices, but something that stalls badly on (say) the 2237th and 9863rd may quite possibly end up showing a random thing rather than the one it is actually struggling with, that is, should you have put that sort of time() test around your screen updates.]
See Also: | gShow