<chapter id="live-gfx">
<title>Live Graphics</title>

<indexterm>
<primary>Live Graphics</primary>
</indexterm>
<indexterm>
<primary>gogui-gfx</primary>
</indexterm>

<para>
GoGui can display graphical data on the Go board while a command
is in progress.
Live graphics commands are considered temporary information
about what the program is currently thinking. For displaying
permanent information, use the <userinput>gfx</userinput> analyze command type.
</para>
<para>
The Go program invokes live graphics commands by writing draw commands to its
standard error stream.
Every line that starts with <userinput>gogui-gfx:</userinput> is interpreted
by GoGui as a draw command using the same syntax as in the
<userinput>gfx</userinput> analyze command type (however, the merging of
multiple TEXT draw commands to a multi-line text for display in a separate
window is not performed).
If no draw command follows immediately after
<userinput>gogui-gfx:</userinput>, all following lines until the next empty
line will be interpreted as draw commands.
See the <userinput>dummy-live_gfx</userinput> command in
<xref linkend="reference-dummy"/> for an example.
</para>
<para>
Before each set of draw commands, existing markup on the graphical board
will be automatically cleared, but not the text in the status bar.
</para>

<para><!-- Empty paragraph to enforce space in JEditorPane --></para>

<note>
<simpara>
Since the parsing of the standard error stream stops when the command response
is received, and Java does not allow to guarantee the correct order of
standard error and response stream, there is a small chance that a live
graphics command, which arrives shortly before the response, is handled during
the next GTP command. You can avoid this situation by pausing for short amount
of time after writing live graphics commands or by explicitly writing a
<userinput>gogui-gfx: CLEAR</userinput> command to standard error before the
command ends.
</simpara>
</note>

<para><!-- Empty paragraph to enforce space in JEditorPane --></para>

</chapter>
