changeset 29505:a41c4b9ed648 stable

issue warning when gnuplot graphics toolkit is initialized * __init_gnuplot__.cc (gnuplot_graphics_toolkit constructor): Issue warning on the first call.
author John W. Eaton <jwe@octave.org>
date Thu, 08 Apr 2021 00:15:34 -0400
parents 0e734bdfd6b2
children 71b074e75198 7e987b69ebde
files libinterp/dldfcn/__init_gnuplot__.cc
diffstat 1 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;