Forum > Linux
[Solved] WordWrap on TMemo not working on Linux
Tim S:
This 'should' be a simple problem to fix I just cannot find a solution.
I'm using version 4.2 of Lazarus on Ubuntu but have tried in the past with earlier versions of Lazarus; and Ubuntu and other flavors of Linux.
I've also tried on Windows and it just works there.
I've tried changing things like scrollbars with no joy.
I've messed around with crlf (#13#10) but that shouldn't be part of the problem. The line that gets wordwrapped doesn't have crlf's in it after the word wrapping.
Any help or suggestions would be greatly appreciated!
Hartmut:
Welcome to the Forum!
I use TMemo.WordWrap on Ubuntu 18.04 .. 24.04 without problems with different Lazarus versions up to 3.4.0.
You should always give us more details when you have problems.
--- Quote from: Tim S on September 27, 2025, 05:34:17 am ---I've tried changing things like scrollbars with no joy.
--- End quote ---
How is this related to your WordWrap problem?
--- Quote ---The line that gets wordwrapped doesn't have crlf's in it after the word wrapping.
--- End quote ---
Does this mean: you get a wordwrap where you don't expect one?
Please show us the source code of this line and a screenshot of your Memo.
The best would be to see your whole code or - more better - to provide a compilable project for us. But at least please show us the complete configuration of your Memo. Either it's source code or it's *.lfm file.
Tim S:
Thanks for the response Hartmut, and for the welcome :-)
I'll try to explain myself again. I seem to have failed the first time. My apologies!
. I create a project with a Form.
. I place a memo on the form. (No changes to the default ... WordWrap = True in the Object Inspector)
. I run the project.
When the project is running I type in the memo. Wordwrap has no effect.
Following is the contents of .lfm file.
object Form1: TForm1
Left = 314
Height = 229
Top = 177
Width = 313
Caption = 'Form1'
ClientHeight = 229
ClientWidth = 313
LCLVersion = '4.2.0.0'
object Memo1: TMemo
Left = 56
Height = 98
Top = 64
Width = 208
Lines.Strings = (
'Memo1'
)
TabOrder = 0
OnChange = Memo1Change
end
end
. I have upload the whole project and two .jpg files:
. The first .jpg (MemoTest1.jpg) j shows text added just prior to the point that I would Wordwrap to take effect.
. The second .jpg (MemoTest2.jpg) shows after three more characters are added. They keep getting added to the and of the line and the beginning of the line goes out of view. Wodwrap does not take effect
(I compared the same project created from scratch on Windows and the .lpm file is identical.)
. If I turn WodWarp = False the following line is added to the .lfm file
WordWrap = False
. If I manually edit the .lfm file to change Wordwrap = True it has no effect
Thaddy:
Never edit the lfm file manually. It can be done, but only if you really know what you are doing (expert).
Consider the lfm read-only and change the properties through the object inspector or in code.
Beginners should NOT touch the lfm.
Martin_fr:
My first question would have been: gtk2? gtk3? qt5? qt6? ....
But, looking at your image, the text you typed has no spaces, it consists of ONE very long word. With that, I do get the same (non wrap) behaviour (gtk2). But as soon as I put in spaces it will wrap at the spaces.
I don't know if that is indented. I haven't tested on Windows or other OS, or WidgetSets. So I can't tell if it should or should not break the ONE very long word.
Can you confirm, that the issue is indeed affecting "single very long words"?
Or does it also fail for you, if you have spaces in the text (and no single word is longer than the available widths)?
Navigation
[0] Message Index
[#] Next page