[Lazarus] Linux GUI Application define CONSOLE

Sven Barth pascaldragon at googlemail.com
Sat Apr 13 23:49:59 CEST 2013


On 13.04.2013 18:48, Daniel Simoes de Ameida wrote:
> I´m confusing... I always find out that the "CONSOLE" directive exists
> only for applications that does not require a GUI.... or in other words,
> applications that does not require a X server
>
> How can I distinguish applications in Text mode (CONSOLE) from Graphics
> Applications (GUI) ?

You can't as leledumbo wrote already. The compiler will even warn if you 
use "$apptype ..." in the main program file on Unix systems, because it 
is simply not supported there.

As a sidenote: checking for "ifdef console" or "ifdef gui" is 
problematic, because you will only be aware of a change if your units 
are completely recompiled. If you change the setting (e.g. by not using 
the IDE dialogs, but by manually adding "apptype console" to your 
program file) the compiler will only recompile the main program unit and 
your units won't detect a change.

Regards,
Sven




More information about the Lazarus mailing list