code: public static void bind (Layer layer, final Signal<Clock> paint, final Slot<Clock> onPaint) {
      layer.state.connectNotify(new Slot<Layer.State>() {
        public void onEmit (Layer.State state) {
          _pcon = Closeable.Util.close(_pcon);
          if (state == Layer.State.ADDED) _pcon = paint.connect(onPaint);
        }
        private Closeable _pcon = Closeable.Util.NOOP;
      });
    }
docs: Automatically connects {@code onPaint} to {@code paint} when {@code layer} is added to a scene
  graph, and disconnects it when {@code layer} is removed.