Thanks for the info. Knowing it was supposed to work was enough to help me figure out why it doesn't -- I hadn't set CANVASBOX=YES on the control when changing it from a canvas to a backgroundbox. Adding that and it behaves exactly as before. I also reviewed my code (haven't updated this in a long time) and it actually only draws as a result of ACTION, but calls IupUpdate and IupRedraw at various points to trigger the redrawing. Looks like everything's working as expected now. Thanks again!
On Tue, Jun 22, 2021, at 1:07 PM, Antonio Scuri wrote: > If you are not using the BACKIMAGE attribute, IupBackgroundBox doesn't draw > on the canvas, and all the canvas callbacks are available. > > IupBackgroundBox is not a different control than a IupCanvas. It is exactly > the same, but it has support for distributing elements on top of it. It was > designed so you can draw on the background that lays behind other elements. > > The IupFlatFrame element is an example. It draws its own IupFrame like > container. But I would like to avoid the CD dependency in this case so I used > the IupDraw API instead. But CD could be used. > > CD drawing was designed in another age when we can draw anytime on the > canvas. > > Drawing behind a native element has some limitations. You have to cooperate > with the other controls. IupDraw was designed with that in mind. Again this > does not invalidate the use of CD. > > And then we reach the same conclusion as you did, when drawing outside the > ACTION callback sometimes you will get weird results when the child elements > are also drawn. It may work but I don't think it will always work. Especially > in modern OS where drawing is buffered. > > Best, > Scuri > > > Em ter., 22 de jun. de 2021 às 14:36, Isaac Raway <is...@mm.st> escreveu: >> I attempted to draw directly to it as with a canvas, but this didn't seem to >> work properly for some reason. I think it is because my code draws at times >> other than in response to an ACTION which seems to not be supported for this >> control? >> >> Get Outlook for Android <https://aka.ms/AAb9ysg> >> >> _______________________________________________ >> Iup-users mailing list >> Iup-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/iup-users > > _______________________________________________ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users >
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users