Widget.addTickCallback

Queues an animation frame update and adds a callback to be called before each frame. Until the tick callback is removed, it will be called frequently (usually at the frame rate of the output device or as quickly as the application can be repainted, whichever is slower). For this reason, is most suitable for handling graphics that change every frame or every few frames. The tick callback does not automatically imply a relayout or repaint. If you want a repaint or relayout, and aren't changing widget properties that would trigger that (for example, changing the text of a gtk.Label), then you will have to call queueResize() or queuDrawArea() yourself.

gdk.FrameClock.FrameClock.getFrameTime() should generally be used for timing continuous animations and gdk.FrameTimings.FrameTimings.getPredictedPresentationPime() if you are trying to display isolated frames at particular times.

This is a more convenient alternative to connecting directly to the "update" signal of GdkFrameClock, since you don't have to worry about when a GdkFrameClock is assigned to a widget.

  1. void addTickCallback(bool delegate(Widget, FrameClock) callback)
    class Widget
    void
    addTickCallback
    (
    bool delegate callback
    )
  2. uint addTickCallback(GtkTickCallback callback, void* userData, GDestroyNotify notify)

Parameters

callback bool delegate

function to call for updating animations

Meta