Index

Package: Add_Tick_Callback_User_Data (generic)

Description

generic
      type User_Data_Type (<>) is private;
      with procedure Destroy (Data : in out User_Data_Type) is null;
   package Add_Tick_Callback_User_Data is

Types

User_Data_Type

type User_Data_Type (<>) is private;

Gtk_Tick_Callback

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 Gtk.Widget.Add_Tick_Callback. Since: gtk+ 3.8 "widget": the widget "frame_clock": the frame clock for the widget (same as calling gtk_widget_get_frame_clock) "user_data": user data passed to Gtk.Widget.Add_Tick_Callback.

Subprograms & Entries

Destroy

procedure Destroy 
(Data: in out User_Data_Type) is null;

Add_Tick_Callback

function Add_Tick_Callback 
(Widget: not null access Gtk.Widget.Gtk_Widget_Record'Class;
Callback: Gtk_Tick_Callback;
User_Data: User_Data_Type;
Notify: Glib.G_Destroy_Notify_Address) return Guint;
Queues a 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 an 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.Gtk_Label), then you will have to call Gtk.Widget.Queue_Resize or Gtk.Widget.Queue_Draw_Area yourself. Gdk.Frame_Clock.Get_Frame_Time should generally be used for timing continuous animations and Gdk.Frame_Timings.Get_Predicted_Presentation_Time if you are trying to display isolated frames at particular times. This is a more convenient alternative to connecting directly to the Gdk.Frame_Clock.Gdk_Frame_Clock::update signal of Gdk.Frame_Clock.Gdk_Frame_Clock, since you don't have to worry about when a Gdk.Frame_Clock.Gdk_Frame_Clock is assigned to a widget. Since: gtk+ 3.8 "callback": function to call for updating animations "user_data": data to pass to Callback "notify": function to call to free User_Data when the callback is removed.