On 06-06-2019 06:08, Alex X wrote:

Another question: Is there any way to draw over a widget easily? e.g., get a context of a widget and just draw on it over all the children widgets for a container and it not mess with anything(just purely visual).

I have overridden the addOnDraw, the problem is I need to sync two addOnDraws...

It would be better to be able to get the context for the widget I want then draw to it in a single addOnDraw so they will always be in sync.

This should work for drawing on top of widgets:

addOnDraw(&draw);

bool draw(Scoped!Context cr, Widget widget)
{
     widget.getWidgetClass().draw(widget.getWidgetStruct(), 
cr.getContextStruct());

     cr.moveTo(0,0);
     cr.lineTo(100,100);
     cr.stroke();

     return true;
}