On 2017-05-04 12:03, Mark Morgan Lloyd wrote:
>> I've not used Freevision/Turbovision before, but am experimenting with
>> James Clarke's DialEdit as an experiment to see whether I can create a
>> fallback user interface for use if an interactive program is running in
>> a shell session. The Lazarus side of things isn't a problem, I know from
>> the past how to break out before the GUI is initialised and so on.
> I was mistaken, this can't be done easily so there's no advantage in 
> trying to build a single program for both GUI and text modes.
> 


And it wouldn’t be right if I didn’t offer up an alternative. fpGUI
based applications can indeed do what you want. I do this all the time
for command line handling. If a GUI program is run from a terminal (no
X11 server), it will still output to the console telling the user what
program it is, version info, command line parameters and importantly,
that it requires a GUI to function. In a GUI environment (eg: MS
Windows) 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):

=======================================
$ ./osmail -h
Opensoft Mail & News v1.00 (build 18)
Compiled on 2017/05/01 11:09:41

The following parameters are available:

   h, help        Shows this help
   lc             Logs debug information to the console
   lv             Logs debug information to a visual screen
   ls             Logs debug information to debug server
   l              Logs debug information to a file
   style          Applies a custom style to the application. Available
                  options are: "auto", "Win2000", "Motif", "Carbon",
"Plastic Dark", "Plastic Dark Gray", "Plastic Medium Gray", "Plastic
Light Gray"

NOTE: This program requires a graphical windowing environment to function.
$
=======================================

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

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
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to