[Lazarus] Lazarus implementation of TListView etc?

Bo Berglund bo.berglund at gmail.com
Sat Oct 31 00:24:35 CET 2015


On Fri, 23 Oct 2015 17:13:55 +0200, Sven Barth
<pascaldragon at googlemail.com> wrote:

>Am 23.10.2015 14:29 schrieb "Bo Berglund" <bo.berglund at gmail.com>:
>> So I am a bit surprised that just using this unit would make the FPC
>> command program not work...
>
>It's not exactly FPC's fault, but more that one must not take one's
>environment for granted. E.g. on Windows you basically always have a GUI
>which is provided by the core OS (yes, there are things like headless
>servers or the new Windows 10 for IoT). On Linux systems on the other hand
>the GUI is entirely optional and provided by the distribution (I simplified
>here). In addition there can be multiple GUI toolkits (GTK and Qt to name
>two). If you now have for some reason a dependency on a Qt library but try
>to run it on a system without Qt your applications won't work.
>This part is solved by not using the Interfaces unit which is required for
>LCL GUI applications and which pulls in the widgetset (WinAPI, GTK, Qt,
>etc.) dependency (you are already doing this).
>However there /might/ be unit initialization sections in the LCL units that
>rely on the fact that the widgetset had been initialized (because the
>Interfaces unit is usually one of the first used in the program file) and
>thus will result in a crash during the initialization of the unit.
>Again this does not happen with Delphi's VCL as there is no such widgetset
>abstraction like the LCL has, because it directly accesses the WinAPI
>(which is always there).
>
>So I at least suggest you to split the GUI and non-GUI parts of the unit to
>be on the really safe side.
>
OK, thanks for the explanation!
I guess that I will have a run-through of the methods in that unit and
exclude all GUI related ones from the unit copy, thus minimizing code
and getting rid of LCL altogether.

My most recent investigation is about how to create a TCPIP socket
object that has event driven receive functions. I have no use for the
problem unit in that quest so this thread is not really valid for
those problems. Last I tested Indy10 with the help of Remy Lebeau but
in the end I got caught by my inability to use a blocking socket with
threads and fire off events into the main code running as the command
line program.
I cannot use Synchronize because then the events fire off only when
the main program code ends and if I don't use Synchronize then I get a
SIGSEG exception somewhere.
Seems like I am crashing into the problem hinted at by several
commentators here that it is near impossible unless the program is a
GUI one....

I have taken a break for a few days now.


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list