Re: Is FLTK (Linux, 1.5.0) usable in batch mode (without display)?
"'Albrecht Schlosser' via fltk.general"
13:57 Sep 29
On 9/29/26 14:25 Basile Starynkevitch
wrote:
Is it possible to code some open source FLTK software which
can (like GNU emacs with its --nwoption) be used in batch mode (without screen,
keyboard, mouse).
Yes, see fluid. If used with fluid -c (or some other commands), it
doesn't open a display.
An interesting example might be for
instance to improve the CubeView example so that with
the
--show-pid-in-batch program
option it would just output a message showing its pid (using
getpid()) and would still work on Linux computer when started
using the batch utility (or crontab).
The following program (taken from
test/hello.cxx and modified) displays its PID without having a
display:
Your code must determine whether it's run in batch mode and must
not open the display. There are a lot of things that would open
the display, for instance any drawing calls, some font handling
stuff, and - obviously - showing a window.
Note that I left everything except showing the window in the demo
code above to demonstrate that a lot of stuff "works" w/o a
display.
There is no switch that would just not open the display and skip
anything that would be done *if* the display was opened.
Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.