From 6f8ed5a85d550d79476376bdf95ebe3c1a256018 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 8 Feb 2026 17:59:01 +0100 Subject: [PATCH] Set window class name (xclass) in test/editor ... to avoid side effects under Windows where the default would prevent entering emoji's with the emoji palette if the WNDCLASS begins with "edit" (conflict with a system WNDCLASS). This is also documented in the respective tutorial chapter. --- documentation/src/editor.dox | 6 ++++++ test/editor.cxx | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/documentation/src/editor.dox b/documentation/src/editor.dox index 8d9d2fb1e..5a33b4be7 100644 --- a/documentation/src/editor.dox +++ b/documentation/src/editor.dox @@ -57,6 +57,7 @@ Fl_Double_Window *app_window = NULL; void tut1_build_app_window() { app_window = new Fl_Double_Window(640, 480, "FLTK Editor"); + app_window->xclass("fl_editor"); } int main (int argc, char **argv) { @@ -66,6 +67,11 @@ int main (int argc, char **argv) { } \endcode +Note: setting the xclass() of the window is not required but it is considered + good style. In this case it works around a known side effect under \b Windows + where leaving the default ("editor.exe") would prevent entering emojis with + the emoji palette. You can ignore this for now in this tutorial. + Passing `argc` and `argv` to `Fl_Double_Window::show()` allows FLTK to parse command line options, providing the user with the ability to change the color or graphical scheme of the editor at launch time. diff --git a/test/editor.cxx b/test/editor.cxx index c989b9dd7..01bc96d42 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -4,7 +4,7 @@ // This program is described in chapter "Designing a Simple Text Editor" // of the FLTK Programmer's Guide. // -// Copyright 1998-2025 by Bill Spitzak and others. +// Copyright 1998-2026 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -31,6 +31,7 @@ Fl_Double_Window *app_window = NULL; void tut1_build_app_window() { app_window = new Fl_Double_Window(640, 480, "FLTK Editor"); + app_window->xclass("fl_editor"); } #endif