[Lazarus] TextHeight in Console App

Graeme Geldenhuys graeme at geldenhuys.co.uk
Wed May 15 17:39:33 CEST 2013


On 2013-05-15 15:02, Edilson Vieira wrote:
> I really do not understand why I can not make a console App that uses the
> Graphics unit because in Delphi there is no problem on that.

In Windows it is not really noticeable, because ALL Windows
installations have access to a GUI. You simply don't get Windows (even a
server install) that doesn't have a GUI. For a server, that is really a
waste of resources. Linux, FreeBSD etc are quite different, where a
server install often [really] has no GUI at all (no X11 is installed).

So for "real" console apps, you don't have access to Clipboard, Graphics
etc units - because they all depend on a GUI sub-system being available.

If you are only going to deploy your app on Windows, then you can indeed
setup a LCL package dependency to your "console" app, include the
Graphics unit and use TBitmap. But remember that your app might not have
a user interface, bit in still depends on he GUI sub-system, so is not
considered a true console application. Just don't expect that
application to run under Linux or FreeBSD servers though.

This is nothing odd or strange, just things Windows developers often
don't realize, because they only know one OS. There knowledge of
cross-platform development is often lacking.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/





More information about the Lazarus mailing list