Forum > Linux
[Solved] WordWrap on TMemo not working on Linux
Hartmut:
I ran your project on Ubuntu 24.04 with Lazarus 3.4.0 / FPC 3.2.2 and everything works as it should.
The default for TMemo.WordWrap is True. When I type in a couple of words - separated by blanks - as soon as a line is full, the next word is broken to a new line. But if I type in words, which are longer than the line, they are *not* broken and you need to scroll horizontally. Because WordWrap, as the name says, breaks only at word boundaries. This all is the correct behavior.
If I change TMemo.WordWrap to be False, no wordwrap occurs. If I type in more characters, than the line is long, there is no wordwrap, even if there are blanks and I need to scroll horizontally. But I can force a new line by pressing ENTER. This also is a correct behavior.
If you want you can configure automatic scrollbars.
Do you have another behavior? If yes, please describe it detailed that we can halp you.
Tim S:
Thanks for all the replies. I fell like a bit of a goose.
It does indeed wrap on smaller words!
I was fooled perhaps by the behavior on windows which does wrap the long line with no spaces.
Hartmut:
Don't worry, we all sometimes happen to enter a wrong path... Especially a couple of differences in the behavior of Controls between Windows an Linux can make our life complicated.
If your question is now solved, it would be kind to mark your Topic accordingly. Most users do this by modifying their 1st post (you must login before) and place a [SOLVED] at the beginning of the subject.
Have fun with FPC / Lazarus ;-)
Martin_fr:
I don't know about "its intended to to words only".
If on Windows it does force mid-word wrapping... Well, then it depends.
1) Is it on Windows handled by the OS or the LCL ? (need to be checked in the code)
2) Is it on Linux (and others / actually Gtk or QT, Cocoa) handled by the OS or LCL
E.g. it may be handled by OS/WS code, but some may not support it, and then LCL my emulate it.
If in any case it is emulated by the LCL, and if in that case it does not do as observed on Windows, then maybe that case should be improved....
But that is a lot of "if"s.
Btw, other edits with word wrap do exist, depending what you need.
I should guess that AtSynEdit supports it (with forced mid word wrap, but I don't know).
And TSynEdit does, but only in 4.99, and you need to create the plugin in code.... (and docs are still missing)
Zvoni:
What he's probably looking for is this "LineBreak" (or whatever it's called - german Windows here) we know from NotePad on Windows (NOT NOtepad++!!)
Usually found in Menu "Format"
Navigation
[0] Message Index
[#] Next page
[*] Previous page