[Lazarus] Startup environment: to Gui, or not to GUI?
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Tue Apr 11 12:06:05 CEST 2017
On 2017-04-11 10:15, Mark Morgan Lloyd via Lazarus wrote:
> Is there an orthodox way that a Lazarus program can very early on look
> at how it's been started and decide whether it can usefully fall back to
> a text mode, e.g. to display help info on stdout rather than a messagebox?
In the past I've used a start-up script (unix) or a start-up console app
(unix & windows) to detect the environment, then launch the correct
binary executable. At the time I didn't know what this the "correct" way
of doing this, but I looked for things like x11 in the process list, or
looked at the environment variables (eg: DISPLAY). Under Windows I
simply you always know a GUI exists, but you can still test to see if
stdout is available or now (eg: I have windows GUI apps that output help
to a console or ShowMessage() dialog.).
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the Lazarus
mailing list