[fpc-pascal] How to make TCheckBox autosize work correctly on Linux?
Bo Berglund
bo.berglund at gmail.com
Wed Jan 7 10:39:24 CET 2026
On Tue, 6 Jan 2026 23:50:43 +0000, Martin Wynne via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:
>On 06/01/2026 23:15, Bo Berglund via fpc-pascal wrote:
>> Did not work:
>>
>> Error: Identifier not found "ControlCanvas"
>>
>> Where is this item declared?
>
>Sorry, that was Delphi code for Windows. In Lazarus for cross-platform
>do this:
>
>uses
> LCLIntf;
>
>var
> w,h:integer;
>
>begin
> with checkbox do begin
> AutoSize:=False;
> Caption:='new text';
> GetTextSize(Font,Caption,w,h);
> Width:=w+30;
> end;
>
>
Tested but:
Still not working:
Error: Identifier not found: GetTextSize
Does this depend on something outside of Lazarus?
--
Bo Berglund
Developer in Sweden
More information about the fpc-pascal
mailing list