misunderstanding about styles (FLTK 1.4/Linux/X11)

23 views
Skip to first unread message

Basile Starynkevitch

unread,
Apr 27, 2022, 2:44:14 PM4/27/22
to fltk.general

Hello all,

I am a complete newbie about FLTK.

On Linux/Debian/bookworm/sid (x86-64) with X.Org version: 1.21.1.3 server

I compiled FLTK from its source code. FLTK git commit being 4618fa9053217f and using
'./configure'  '--with-abiversion' '--with-optim=-O2 -g' '--enable-debug' to configure FLTK.

libc is (Debian GLIBC 2.33-7)

GCC (so c++ or g++) is g++ (Debian 11.3.0-1)


My keyboard is French (AZERTY) so has a key labeled §  (shifted) or ! (unshifted).

My sample program  fltk-mini-edit.cc (to learn FLTK, it is GPLv3+ licensed), inspired by existing texteditor-with-dynamic-colors.cxx, is on github: https://github.com/bstarynk/misc-basile/blob/master/fltk-mini-edit.cc and I am referring to its git commit ee2a0dd

The build script to compile that sample program is also on github: https://github.com/bstarynk/misc-basile/blob/master/mini-edit-build.sh

That simple fltk-mini-edit is expected to show in red unicode characters like ° (or €; I have AltGr E key bound to that).

For some reason, it does not.

What am I doing wrong?

Basile Starynkevitch
92340 Bourg-la-Reine, France

PS. My hope, if I am able to understand how to use FLTK, is to use it in the RefPerSys open source symbolic artificial intelligence system (inspired by books from Jacques Pitrat, .. I recommend reading some of them).


Mo_Al_

unread,
Apr 28, 2022, 6:30:09 AM4/28/22
to fltk.general
I've tried building your program on ubuntu and it shows this:

So the characters appear correctly. Tried with both default build of FLTK and with --enable-pango (via configure).
Could it be a system fonts issue.

I've had to modify things to get the build working, changed `static constexpr` arrays style_table and stylename_table to `static inline` (guess my g++ version requires the explicit inline call, `static inline constexpr` also works).

Mo_Al_

unread,
Apr 28, 2022, 7:10:27 AM4/28/22
to fltk.general
If you mean the different color for unicode, it's because you pass a different array length to hightlight_data:

  highlight_data(stybuff, style_table,
                 (unsigned)Style__LAST-1,
                 'A', 0, 0);

Try:
  highlight_data(stybuff, style_table,
                 (unsigned)Style__LAST,
                 'A', 0, 0);

Which gives:

Basile Starynkevitch

unread,
Apr 28, 2022, 8:46:29 AM4/28/22
to fltkg...@googlegroups.com, refpers...@framalistes.org, te...@refpersys.org


On 4/28/22 12:30, Mo_Al_ wrote:
I've tried building your program on ubuntu and it shows this:


I see the same on my computers.


So the characters appear correctly. Tried with both default build of FLTK and with --enable-pango (via configure).
Could it be a system fonts issue.


No, they don't.  https://github.com/bstarynk/misc-basile/blob/master/fltk-mini-edit.cc has (in commit ee2a0dd ...) at line 112



[Style_Unicode] = //
{ FL_DARK_RED, FL_HELVETICA_BOLD, 17, ATTR_BGCOLOR, FL_GRAY0 }, //:Style_Unicode,



And neither your picture nor my screen is showing anything in red. I was expecting the § sign to appear in red.


Thanks for your help.


I've had to modify things to get the build working, changed `static constexpr` arrays style_table and stylename_table to `static inline` (guess my g++ version requires the explicit inline call, `static inline constexpr` also works).


Thanks for the feedback. I just git pushed commit 0565f5f


Regards



--
Basile Starynkevitch                  <bas...@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/

Basile Starynkevitch

unread,
Apr 28, 2022, 8:46:36 AM4/28/22
to fltkg...@googlegroups.com, te...@refpersys.org

A big thanks. Sorry for my stupid mistake. Did commit e77a443

--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/i-1SbQUnfVA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/05cacb1d-8b2d-4cd0-9409-310135b814bcn%40googlegroups.com.

Matthias Melcher

unread,
Apr 29, 2022, 4:52:30 AM4/29/22
to fltk.general
bas...@starynkevitch.net schrieb am Mittwoch, 27. April 2022 um 20:44:14 UTC+2:
'./configure'  '--with-abiversion' '--with-optim=-O2 -g' '--enable-debug' to configure FLTK.

Not sure if this is a transcribing issue, but writing '--with-optim=-O2 -g' in single quotes, doesn't that present as '-O2 -g' as the optimising option, ignoring '-g' as a stand-alone option? Maybe I am just to picky or paranoid, but IMHO, there should be no quotes around the options. Having them around the filename is correct though in case the full path had a space character in it.
 
Reply all
Reply to author
Forward
0 new messages