[Lazarus] Startup environment: to Gui, or not to GUI?

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu May 4 15:30:20 CEST 2017


On 04/05/17 12:00, Graeme Geldenhuys via Lazarus wrote:
> On 2017-05-04 11:18, Mark Morgan Lloyd via Lazarus wrote:> In case it helps anybody avoid wasted time: looking carefully at what > I've been doing, it turns out that it's not possible to make an > LCL-based program running on unix (i.e. with X11 etc.)
> And it wouldn’t be right if I didn’t offer up an alternative. fpGUIbased applications can indeed do what you want. I do this all the timefor command line handling. If a GUI program is run from a terminal (noX11 server), it will still output to the console telling the user whatprogram it is, version info, command line parameters and importantly,that it requires a GUI to function. In a GUI environment (eg: MSWindows) it will display a dialog with all the same information, if the-h command line parameter was passed in.
> Here is such output of one of my programs (run from the login terminal -no X11):

Agreed, such as --help or --version output. However it looks as though 
it's important to check anything that attempts this on e.g. the system 
text-mode console or over something really crude like telnet... and I 
hope you're doing that for fpGUI since you keep telling us how good it 
is :-)

> So as you can see, what you want to do is possible. Maybe LCL just needsmore work around its initialization code - being less eager toinitialize its GUI. ;-)

I think it could probably be done by slipping a unit in just before 
cthreads, provided that this terminated aggressively. That's actually 
less intrusive that the editing I've been doing in the .lpr 
initialisation block, but it would mean splitting out e.g. text-mode 
--help and graphics-mode --about into separate places.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


More information about the Lazarus mailing list