[Lazarus] TFrame improvements
lazarus at kluug.net
Mon Nov 29 12:38:46 CET 2021
On 29.11.2021 12:32, Michael Van Canneyt via lazarus wrote:
> On Mon, 29 Nov 2021, Martin Frb via lazarus wrote:
>> On 29/11/2021 12:05, Michael Van Canneyt via lazarus wrote:
>>> What do you mean 'artificial restrictions' ? The above is quite
>> IMHO "if csLoading" tests are also "quite standard"
>> "If HandleCreated" exist too, not sure how widespread....
>> "accessing canvas" outside paint, is discouraged.
> Well, as I understood it, painting code will not work on Mac outside the
> paint event, so only using canvas inside paint should be standard ?
You can still use the Canvas outside Paint for measuring. But not for
painting. Painting outside Paint on Windows it is problematic as well.
The "use the Canvas outside Paint for measuring" is valid of course only
as long as Canvas is there or can be created - and it can be created
when the handle is created or can be created. And a (normal) control's
handle can be created only when a parent is set.
That is the problem - the code tries to access canvas when the control's
handle cannot be created.
More information about the lazarus