View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0019624||Lazarus CCR||-||public||2011-06-24 23:01||2011-10-14 19:31|
|Reporter||Heinrich Wolf||Assigned To||Vincent Snijders|
|Summary||0019624: 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 https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/richmemo/“. On Linux I had to apply the patch from http://bugs.freepascal.org/view.php?id=17319 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:
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 http://www.lazarusforum.de/viewtopic.php?f=18&t=5110 . 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.
|Tags||No tags attached.|
I was notified, that this is duplicate to
|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|