View Issue Details

IDProjectCategoryView StatusLast Update
0019624Lazarus CCR-public2011-10-14 19:31
ReporterHeinrich Wolf Assigned ToVincent Snijders  
Status resolvedResolutionduplicate 
Summary0019624: TRichMemo does not save to nor load from a file on Linux with GTK2

I would like to create an RTF file on hard disk without user input. To do this, I installed RichMemo from „svn co“. On Linux I had to apply the patch from to be able to install it. Consecutively I append formatted text pieces to a hidden RichMemo and then write it's content to a FileStream. On Windows that works, but on Linux I always get an empty file, although I see the correct content in the RichMemo.

1st problem (solved):
If I set visible := false, then the RichMemo does not accept text. Instead I keep visible := True and cover the RichMemo with a Panel.

2nd problem (Linux only, solved):
RichMemo.SelStart := RichMemo.GetTextLen;
RichMemo.SelText := s;
only works on Windows, but not on Linux. Instead I use
RichMemo.Text := RichMemo.Text + s;
But then I lose all formatting so far. So I collect all formatting in a TList and apply them not before all concatenations are done.

3rd problem (solved):
I pass UTF8 encoded text pieces.
returns numbers, which are not suitable for setting the range of formatting. Instead I maintain my own length:
Inc(RichLen, UTF8Length(s));

4th problem, not solved, please help!
This code to save the text in a file only works on Windows. In Linux I always get an empty file.
Stream := TFileStream.Create(SaveDialog.FileName, fmCreate);

I already posted these questions in . Someone answered that the code for SaveRichText in GTK2 does not yet exist.

I created an RTF file with the samples/testsimple projekt on Windows and tried to load this file with the samples/testsimple projekt on Linux. But then I get an empty window. Maybe the code for LoadRichText in GTK2 also does not yet exist.

kind regards
TagsNo tags attached.
WidgetsetGTK 2
Attached Files


duplicate of 0015894 resolvedDmitry Boyarintsev Trichmemo on GTK2 wouldn't save or load richtext 


Heinrich Wolf

2011-06-27 20:30

reporter   ~0049458


I was notified, that this is duplicate to

kind regards

Issue History

Date Modified Username Field Change
2011-06-24 23:01 Heinrich Wolf New Issue
2011-06-24 23:01 Heinrich Wolf Widgetset => GTK 2
2011-06-27 20:30 Heinrich Wolf Note Added: 0049458
2011-10-14 19:31 Vincent Snijders Relationship added duplicate of 0015894
2011-10-14 19:31 Vincent Snijders Status new => resolved
2011-10-14 19:31 Vincent Snijders Resolution open => duplicate
2011-10-14 19:31 Vincent Snijders Assigned To => Vincent Snijders