FLTK-Tutorial-for-Beginners v2 available.

57 views
Skip to first unread message

Andre Steenveld

unread,
Oct 15, 2026, 9:03:55 AMOct 15
to fltk.general
Dear All,

A new version of FLTK-Tutorial-for-Beginners is available.

About a month ago I noticed some problems with 'FLTK-Turorial' for v1.3 which I discussed here. One of the advise was to contact Georg Potthast which resulted in a fruitfull conversation between the two of us. And me becoming the maintainer for the next version.

FLTK-Tutorial version 2 is virtual identical to version 1 with the following extra's:
  • correction of some C++ syntax problems (due to changing standards).
  • tutorial examples tested against FLTK v1.4.5 and v1.5.x
  • a github repository with both versions of the tutorial and all example code using CMake.
  • Tested on Debian Trixie. (todo: test with MSVC).
This turial is up do date again and it should be easier for beginners to work with the examples. I like to thank Georg Potthast for making this possible.

I'm by far not an expert with FLTK (but also no longer an absolute beginner anymore). I can not answer all possible questions about FLTK, I would have to forward it to this forum. This is why I anounce the new version here. If there are any questions related to the FLTK code in the example this is the correct location for asking. I would like to thank the FLTK work group members for the support and time they freely give.

Any suggestion/correction to the tutorial in its current state (or to the CMake structure) is welcome and I will give it my attention.

Kind regards,
Andre Steenveld.

Andre Steenveld

unread,
Oct 16, 2026, 6:36:27 AMOct 16
to fltk.general
> (todo: test with MSVC).
Done, see github repository. It was much easier to do than expected. :-)

Op donderdag 15 oktober 2026 om 15:03:55 UTC+2 schreef Andre Steenveld:

Albrecht Schlosser

unread,
Oct 16, 2026, 9:27:45 AMOct 16
to fltkg...@googlegroups.com
Great, thanks for all your efforts.

I read the entire tutorial (V2) and found some bugs (mostly typos) which I would like to report and/or fix. Unfortunately I couldn't find the source(s) for the PDF file. Wouldn't it be great if others could contribute to the source of the PDF tutorial by using GitHub Issues and PR's?

If not I could "export" the text (pdftotext), edit the exported text, and file a diff, but that would be more effort for both sides and less reliable. What do you think?

For now, here are some issues, some of which were already in the old version (V1), but anyway:

All widget classes use the "Fl_" prefix with capital 'F' and lowercase 'l'. While all the code is fine (otherwise it wouldn't compile on Linux), there are classes mentioned in the text with uppercase 'L' which is wrong.

The same is true for the static class "Fl".

OTOH constants etc. may use the "FL" prefix, but that's intentional. I didn't notice any mistakes in such constants.

Chapter 3. "Installation of the FLTK toolkit" - a.) Linux: "do configure,make,install" : this is no longer possible since FLTK 1.5.0, there's only CMake available, which is fully supported and recommended since 1.4.x (1.4.5 works fine).

Also, in text to/after example9.cpp: s/FL-Pixmap/Fl_Pixmap/ (only 1 occurrence).

There are other places that could be impoved, considering current changes in FLTK, and some typos, but that would be suggestions for an issue, PR, or GitHub Discussion if you decide to enable "discussions".

Thanks again
Albrecht
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fltkgeneral/e7b254de-184d-44a8-ad14-183fdb8b0cben%40googlegroups.com.

Albrecht Schlosser

unread,
Oct 16, 2026, 9:34:18 AMOct 16
to fltkg...@googlegroups.com
I forgot one trivial bug in example 1: 

    Fl_Window win(HEIGHT, WIDTH,"FLTK Tutorial - Example 1");

should read:

    Fl_Window win(WIDTH, HEIGHT, "FLTK Tutorial - Example 1");

(change order of WIDTH and HEIGHT arguments). This wouldn't change the program though, since both constants are 400, but if a user changed the constants they might be surprised. ;-)

Andre Steenveld

unread,
Oct 17, 2026, 2:35:15 AMOct 17
to fltk.general
Hi Albrecht,

Op vrijdag 16 oktober 2026 om 15:34:18 UTC+2 schreef Albrecht-S:
I forgot one trivial bug in example 1: 

    Fl_Window win(HEIGHT, WIDTH,"FLTK Tutorial - Example 1");

should read:

    Fl_Window win(WIDTH, HEIGHT, "FLTK Tutorial - Example 1");

(change order of WIDTH and HEIGHT arguments). This wouldn't change the program though, since both constants are 400, but if a user changed the constants they might be surprised. ;-)
...

Thanks for your report, I recorded it as an issue in the github repository. You have the honour of reporting issue #1 ;-)

I will come back on your other points shortly.

Kind regards,
Andre.

 

Andre Steenveld

unread,
Oct 17, 2026, 5:44:20 AMOct 17
to 'Albrecht Schlosser' via fltk.general
Hi Albrecht,



On 10/16/26 3:27 PM, 'Albrecht Schlosser' via fltk.general wrote:
Great, thanks for all your efforts.

I read the entire tutorial (V2) and found some bugs (mostly typos) which I would like to report and/or fix. Unfortunately I couldn't find the source(s) for the PDF file. Wouldn't it be great if others could contribute to the source of the PDF tutorial by using GitHub Issues and PR's?
Let me guess, most of the typos are language related. English is not my native langues (nor is it for Georg).

And another major catagory of problems is the examples.
I have introduces code changes without fully understanding all of the coding standard for FLTK.
While I did test all code and it compiles in GCC and MSVC I can not test the coding standard.
Some of my changes may be short sighted (and mis some points, introducing problems) or too strict than is absolutely required (resulting in stiffer code than is needed).

Georg never made the original source for the PDF file available and is quite fragile, document processor format, not plain text file(s).
Changing the original sources needs carefull attention to not disturb the layout in the PDF file.
That is why I continue with the policy of Georg and do not provide the original source file.

But there are alternatives.
It is possible to load the PDF file in LibreOffice or MS Office and edit that. LibreOffice preserves the layout quite well, I have not tested MS Office.
This option is suitable for correcting language typos. If you make changes and send me the results I can diff it and introduce the changes in the original sources.

For code changes you can change the example sources in the github repository and report issues (with a diff) or make a pull request.
Again, I can take the changes and introduce it in the original sources.

Of cause you can also point out the problem direct, as you did for example1. 


If not I could "export" the text (pdftotext), edit the exported text, and file a diff, but that would be more effort for both sides and less reliable. What do you think?
The repository always contains the latest versions of all examples, exported from the tutorial. The example code is kept in sync with the tutorial PDF.
I included details on how it is done to show the process and then found out that I will be almost the only person needing it. But your welcome to work with it.



For now, here are some issues, some of which were already in the old version (V1), but anyway:

All widget classes use the "Fl_" prefix with capital 'F' and lowercase 'l'. While all the code is fine (otherwise it wouldn't compile on Linux), there are classes mentioned in the text with uppercase 'L' which is wrong.

The same is true for the static class "Fl".

OTOH constants etc. may use the "FL" prefix, but that's intentional. I didn't notice any mistakes in such constants.
I have noticed some of the points but made no changes for it. The code is compiling but is violating the FLTK coding standard.
Should I change it? (IMHO I think I should.) What is your advise?



Chapter 3. "Installation of the FLTK toolkit" - a.) Linux: "do configure,make,install" : this is no longer possible since FLTK 1.5.0, there's only CMake available, which is fully supported and recommended since 1.4.x (1.4.5 works fine).
Noticed that but I have not changed the text. It still works and the aim was to change as little as possible in the text.
For building and testing against both versions of FLTK (v1.4 and v1.5) I only use CMake.
I will put in a remark for it, better to let the tutorial text reflect this.



Also, in text to/after example9.cpp: s/FL-Pixmap/Fl_Pixmap/ (only 1 occurrence).
Done. (only 1 occurrence).



There are other places that could be impoved, considering current changes in FLTK, and some typos, but that would be suggestions for an issue, PR, or GitHub Discussion if you decide to enable "discussions".
I have opened the "discussions" tab.

Thanks again
Albrecht

Thanks for your support.
Andre.





Reply all
Reply to author
Forward
0 new messages