Compilation Units
Tagged Types
procedure Destroy (Data : in out User_Data_Type)
type Gtk_Drawing_Area_Draw_Func is access procedure
(Drawing_Area : not null access Gtk.Drawing_Area.Gtk_Drawing_Area_Record'Class;
Cr : Cairo.Cairo_Context;
Width : Glib.Gint;
Height : Glib.Gint;
User_Data : User_Data_Type);
Whenever Drawing_Area needs to redraw, this function will be called. This function should exclusively redraw the contents of the drawing area and must not call any widget functions that cause changes.
the GtkDrawingArea to redraw
the context to draw to
the actual width of the contents. This value will be at least as wide as GtkDrawingArea:width.
the actual height of the contents. This value will be at least as wide as GtkDrawingArea:height.
user data
procedure Set_Draw_Func
(Self : not null access Gtk.Drawing_Area.Gtk_Drawing_Area_Record'Class;
Draw_Func : Gtk_Drawing_Area_Draw_Func;
User_Data : User_Data_Type)
Setting a draw function is the main thing you want to do when using a drawing area. The draw function is called whenever GTK needs to draw the contents of the drawing area to the screen. The draw function will be called during the drawing stage of GTK. In the drawing stage it is not allowed to change properties of any GTK widgets or call any functions that would cause any properties to be changed. You should restrict yourself exclusively to drawing your contents in the draw function. If what you are drawing does change, call [methodGtk.Widget.queue_draw] on the drawing area. This will cause a redraw and will call Draw_Func again.
callback that lets you draw the drawing area's contents
user data passed to Draw_Func
type User_Data_Type (<>) is private;