Refresh modes
guiSET provides three different draw modes which affect how often the GUI will be drawn. The mode
mostly matters if you want to draw own things on top of the GUI in the famous draw() method. It
can be set using
myFrame.setRefreshMode(Frame.EFFICIENT),myFrame.setRefreshMode(Frame.CONTINOUS)ormyFrame.setRefreshMode(Frame.NO_LOOP).
The default and for most use cases recommended mode is Frame.EFFICIENT. The GUI will be drawn
onto the application surface only when something changed (i.e. hovered over a button which then changes
color).
This is good but maybe you also use the standard draw methods at the same time in your sketch. Then, if you
draw things each frame (each time draw() runs), your drawings will only be cleared out when the
GUI updates. You could call myFrame.forceRender() each time - or choose the
CONTINOUS mode. It will draw the finished GUI image each frame onto the window.
Frame.NO_LOOP is the most efficient (or spartanic) mode. It turns off the draw()
loop and is only updated through mouse and key events. Now it also works to resize the sketch in this mode.
Animations do not work in this mode (yet).
ATTENTION! It seems that NO_LOOP might not be that efficient
after all. Somehow, the Processing sketch still needs a lot of CPU power while waiting for events.
