Hello again.
I've examined Lcl a bit, and although I don't fully understand its logic, I managed to create a working system.
After creating my window, I set up the trigger as follows:
gtk_signal_connect(GTK_OBJECT(PGtkWidget(Result)), 'expose-event', G_CALLBACK(@onDrawEvent),
And here is my drawing code:
function onDrawEvent(widget: PGtkWidget; event: PGdkEvent; user_data: gpointer): gboolean; cdecl;
var
Bmp: TCanvas;
Context: HDC;
begin
Context:= InterfaceBase.WidgetSet.GetDC(THandle(widget));
Bmp:= TCanvas.Create;
Bmp.Handle:= Context;
// Sample drawings
Bmp.Pen.Color:= clBlue;
Bmp.Pen.Width:= 2;
Bmp.Line(10, 10, 100, 100);
// FIA(Bmp);
Bmp.Free;
InterfaceBase.WidgetSet.ReleaseDC(THandle(widget), Context);
Result:= True;
end;
In fact, it's almost identical; I hadn't thought of converting PGtkWidget to THandle.
I hope it's useful to someone.