Basic questions for onUpdate and a background question

For Reference: Toybox.WatchUi.View (garmin.com)

The example shows in the "OnUpdate()" function it calls View.onUpdate(dc);.  What does it mean and is it required?

If we are putting values into labels or creating bitmaps/shapes it seems label values go before it and drawings go after it..  but I'm not sure why.

Another question is setting the background color from the settings/properties file.  Where in relation to the label inputs, bitmap drawings, and calling onUpdate do I set the background color?  This is all very confusing to me on why it's SO particular you get it exactly right.  Unfortunately, in this case I can't even guess what the right order is.  Putting the background color change after onUpdate changes the color but nothing else shows up.  If I put it before then it doesn't change the color at all.

  • View.onUpdate() is only needed if you use layouts.  If you also do dc calls, it needs to be before the dc.calls.

    onSettingsChanged() in your app base gets called when app settings change, and that is a place I load the new colors. and then use those colors in onUpdate.  I also load the settings when the app starts.

  • For example, if I want to draw a background color (new rectangle).  How do you get the layout to appear in front of the background?

  • I manipulate the entire screen, background colour , bitmaps, etc, in onUpdate. I don't use settings/properties at all. In so doing, the components are displayed in the sequence they appear in the onUpdate, effectively layer by layer, with the last ones appearing on top of the previous ones.