api icon indicating copy to clipboard operation
api copied to clipboard

A way to access widgets by ID / mainly canvas

Open dacap opened this issue 2 years ago • 0 comments

We should have a way to access widgets by ID. Mainly a canvas to paint some part of its surface. E.g.

local d = Dialog():canvas{ id=myCanvas }
local ctx = d.widgets.myCanvas.context
-- ... paint in the ctx ...

At the moment the only way to paint in the canvas is using the onpaint event and triggering that event through Dialog:paint() (but the onpaint should be a way to redraw the entire canvas in case of resize, we cached the surface on a offscreen bitmap).

dacap avatar Dec 16 '22 14:12 dacap