[Lazarus] Linux GUI Application define CONSOLE

leledumbo leledumbo_cool at yahoo.co.id
Sun Apr 14 15:54:24 CEST 2013


If your design is modular enough, you can use frontend-backend architecture.
Only the frontend should differ. This could be achieved by having 2 .lpi
referencing the same backend unit, with each own frontend (user interface).

Another way would be to use build mode, differing in -Fu paths. One will
refer to the console unit, while the other to the gui. This way requires you
to have both units having the same interface. To ease maintenance, you could
instead make one unit, but the implementation part is just an {$include}
directive. This time, -Fi (instead of -Fu) will decide the path where the
include file should be searched. So the layout is like:

Solution 1 (-Fu):
-backend.pas
-frontend/
--console/
---frontend.pas
--gui/
---frontend.pas

Solution 2 (-Fi):
-backend.pas
-frontend.pas
-include/
--console/
---frontend.inc
--gui/
---frontend.inc




--
View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Linux-GUI-Application-define-CONSOLE-tp4030537p4030599.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.




More information about the Lazarus mailing list