# HG changeset patch # User John W. Eaton # Date 1617855334 14400 # Node ID a41c4b9ed648aca2de2ab83d43e15da1c53364a8 # Parent 0e734bdfd6b25257d45745ad90cd04a0df724a1b issue warning when gnuplot graphics toolkit is initialized * __init_gnuplot__.cc (gnuplot_graphics_toolkit constructor): Issue warning on the first call. diff -r 0e734bdfd6b2 -r a41c4b9ed648 libinterp/dldfcn/__init_gnuplot__.cc --- a/libinterp/dldfcn/__init_gnuplot__.cc Mon Apr 05 09:09:22 2021 -0700 +++ b/libinterp/dldfcn/__init_gnuplot__.cc Thu Apr 08 00:15:34 2021 -0400 @@ -61,7 +61,28 @@ { public: gnuplot_graphics_toolkit (octave::interpreter& interp) - : octave::base_graphics_toolkit ("gnuplot"), m_interpreter (interp) { } + : octave::base_graphics_toolkit ("gnuplot"), m_interpreter (interp) + { + static bool warned = false; + + if (! warned) + { + warning_with_id + ("Octave:gnuplot-graphics", + "using the gnuplot graphics toolkit is discouraged\n\ +\n\ +The gnuplot graphics toolkit is not actively maintained and has a number\n\ +of limitations that are ulikely to be fixed. Communication with gnuplot\n\ +uses a one-directional pipe and limited information is passed back to the\n\ +Octave interpreter so most changes made interactively in the plot window\n\ +will not be reflected in the graphics properties managed by Octave. For\n\ +example, if the plot window is closed with a mouse click, Octave will not\n\ +be notified and will not update it's internal list of open figure windows.\n\ +We recommend using the qt toolkit instead.\n"); + + warned = true; + } + } ~gnuplot_graphics_toolkit (void) = default;