[Lazarus] WriteLn back to the GUI
anton.k at tut.by
Wed Oct 23 17:37:27 CEST 2013
On 23.10.2013 09:59, ListMember wrote:
> I am trying to find where WriteLn is declared; but, apparently,
> WriteLn is among the select few that Lazarus will ignore 'Find
> Declaration' requests --at least that's how it behaves (latest Lazarus
> stable) on my side.
> My ultimate goal, after finding where it is declared, is to locally
> modify that part of the sources so that (instead of writing to the
> console) it will use a global callback to display whatever WriteLn'ed
> in a TMemo.
> Or, is there already an alternative to redirect console output to the
> running GUI?
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
There was already a discussion on this maillist - try to search
"[fpc-devel] StdOut capture for FPC RTL"
It is possible to create pipe, replace TextRec(output).Handle with pipe
handle and rewrite() that output.
Gui thread just reads from the read end of the pipe and updates via
Syncronize() whatever you want (memo, or even synedit).
But you need to rewrite output for every thread you start later.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus