Compilation Units
Tagged Types
function Add_Tick_Callback
(Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class;
Callback : Gtk_Tick_Callback;
User_Data : User_Data_Type) return Guint
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 label), then you will have to call [methodGtk.Widget.queue_resize] or [methodGtk.Widget.queue_draw] yourself. [methodGdk.FrameClock.get_frame_time] should generally be used for timing continuous animations and [methodGdk.FrameTimings.get_predicted_presentation_time] should be used if you are trying to display isolated frames at particular times. This is a more convenient alternative to connecting directly to the [signalGdk.FrameClock::update] signal of the frame clock, since you don't have to worry about when a frame clock is assigned to a widget. To remove a tick callback, pass the ID that is returned by this function to [methodGtk.Widget.remove_tick_callback].
function to call for updating animations
data to pass to Callback
an ID for this callback
procedure Destroy (Data : in out User_Data_Type)
type Gtk_Tick_Callback is access function
(Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class;
Frame_Clock : not null access Gdk.Frame_Clock.Gdk_Frame_Clock_Record'Class;
User_Data : User_Data_Type) return Boolean;
Callback type for adding a function to update animations. See [methodGtk.Widget.add_tick_callback].
the widget
the frame clock for the widget
user data passed to [methodGtk.Widget.add_tick_callback].
G_SOURCE_CONTINUE if the tick callback should continue to be called, G_SOURCE_REMOVE if it should be removed
type User_Data_Type (<>) is private;