Drawing directly inside a container

Hi all,
I have a container that includes a canvas. I used to do all the drawing inside the canvas, but I recently discovered that I can draw directly inside the container itself without needing the canvas. I removed the canvas and everything still works fine.

I’m curious if this approach is considered the Xojo way of doing things. Are there any pitfalls I might not be aware of? Is this method cross-platform?
Thank you

everything you draw in paint event in milliseconds is ok.
if other things overlap the paint region it may redrawn by paint event.
if you need static graphics you could paint into an image and draw this picture in paint event.

if you use a sub classed canvas this paint is more encapsulated and can be reuse.

Perfectly reasonable.
In a sense, a container is very like a window, and the same approach works there.
To me, one less control on screen is always a plus.
And yes, it is cross platform.

2 Likes

Thank you for your reply

Thank you for your reply, i will go with this approach!