Package: gtk

Function gtk-widget-frame-clock

Lambda List

gtk-widget-frame-clock (widget)

Arguments

widget -- a gtk-widget object

Return Value

A gdk-frame-clock object, or nil if widget is unrealized.

Details

Obtains the frame clock for a widget. The frame clock is a global "ticker" that can be used to drive animations and repaints. The most common reason to get the frame clock is to call the gdk-frame-clock-frame-time function, in order to get a time to use for animating. For example you might record the start of the animation with an initial value from the gdk-frame-clock-frame-time function, and then update the animation by calling the gdk-frame-clock-frame-time function again during each repaint.

The gdk-frame-clock-request-phase function will result in a new frame on the clock, but will not necessarily repaint any widgets. To repaint a widget, you have to use the gtk-widget-queue-draw function which invalidates the widget, thus scheduling it to receive a draw on the next frame. The gtk-widget-queue-draw function will also end up requesting a frame on the appropriate frame clock.

A frame clock of the widget will not change while the widget is mapped. Reparenting a widget, which implies a temporary unmap, can change the frame clock of the widget.

Unrealized widgets do not have a frame clock.
 

See also

2021-9-16