changeset 32172:71a792dfb05a

Emit warning about use of FLTK toolkit. * NEWS.9.md: Announce discouragement of FLTK use and recommendation for qt backend. * __init_fltk__.cc (fltk_graphics_toolkit): Emit warning from constructor that fltk toolkit is discouraged.
author Rik <rik@octave.org>
date Tue, 27 Jun 2023 12:09:56 -0700
parents 4555f9918009
children 984bca088143
files etc/NEWS.9.md libinterp/dldfcn/__init_fltk__.cc
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.9.md	Mon Jun 26 13:18:15 2023 -0700
+++ b/etc/NEWS.9.md	Tue Jun 27 12:09:56 2023 -0700
@@ -37,6 +37,10 @@
 
 ### Graphics backend
 
+* The FLTK backend is not maintained and its use is discouraged.  The
+recommended backend is qt.  Enabling the fltk backend with
+`graphics_backend fltk` now emits a warning.
+
 * The `set` function now accepts any combination of name/value pairs,
 cell array of names / cell array of values, or property structures.
 This change is Matlab-compatible.
--- a/libinterp/dldfcn/__init_fltk__.cc	Mon Jun 26 13:18:15 2023 -0700
+++ b/libinterp/dldfcn/__init_fltk__.cc	Tue Jun 27 12:09:56 2023 -0700
@@ -2263,6 +2263,21 @@
     : octave::base_graphics_toolkit (FLTK_GRAPHICS_TOOLKIT_NAME),
       m_interpreter (interp), m_input_event_hook_fcn_id ()
   {
+    static bool warned = false;
+
+    if (! warned)
+      {
+        warning_with_id
+        ("Octave:fltk-graphics",
+         "using the fltk graphics toolkit is discouraged\n\
+\n\
+The FLTK graphics toolkit is not actively maintained and has a number\n\
+of limitations that are unlikely to be fixed.\n\
+The qt toolkit is recommended instead.\n");
+
+        warned = true;
+      }
+
     Fl::visual (FL_RGB);
   }