Recent

Author Topic: [SOLVED] Unable to add empty lines in label control  (Read 677 times)

artem101

  • Jr. Member
  • **
  • Posts: 84
[SOLVED] Unable to add empty lines in label control
« on: May 23, 2023, 11:15:12 am »
Hello!

I discovered that it's impossible to add empty lines in Label control in Linux.

Code: Pascal  [Select][+][-]
  1.   Label1.Caption:='one'+LineEnding
  2.                  +'two'+LineEnding+LineEnding
  3.                  +'three'+LineEnding+LineEnding+LineEnding
  4.                  +'four';    

Code: Pascal  [Select][+][-]
  1.   object Label1: TLabel
  2.     Left = 0
  3.     Height = 240
  4.     Top = 0
  5.     Width = 320
  6.     Align = alClient
  7.     AutoSize = False
  8.     Font.Height = 13
  9.     ParentColor = False
  10.     ParentFont = False
  11.   end

Tested in Linux Mint 21.1 XFCE and 20.3 MATE. Lazarus version is 2.2.4.

For comparision in Windows it works as expected.

Any ideas? Thanks.
« Last Edit: May 23, 2023, 01:03:52 pm by artem101 »

wp

  • Hero Member
  • *****
  • Posts: 11906
Re: Unable to add empty lines in label control
« Reply #1 on: May 23, 2023, 11:37:26 am »
In Manjaro Linux it works with qt5 widgetset, but I can confirm the issue when I switch to gtk2. As a workaround you could add a space:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   Label1.Caption:='one'+LineEnding
  4.                  +'two'+LineEnding+' ' +LineEnding
  5.                  +'three'+LineEnding+' ' +LineEnding+' ' +LineEnding
  6.                  +'four';
  7. end;

artem101

  • Jr. Member
  • **
  • Posts: 84
Re: Unable to add empty lines in label control
« Reply #2 on: May 23, 2023, 12:33:32 pm »
As a workaround you could add a space

Thanks for idea! It works.

 

TinyPortal © 2005-2018