api
api copied to clipboard
A way to access widgets by ID / mainly canvas
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).