[Lazarus] How many timers available on Linux (Raspberry Pi)?

Bo Berglund bo.berglund at gmail.com
Wed Jul 22 11:55:27 CEST 2020


On Wed, 22 Jul 2020 11:21:07 +0200 (CEST), Michael Van Canneyt via
lazarus <lazarus at lists.lazarus-ide.org> wrote:

>
>
>On Wed, 22 Jul 2020, Bo Berglund via lazarus wrote:
>
>> On Wed, 22 Jul 2020 08:09:08 +0300, "Alexey Tor. via lazarus"
>> <lazarus at lists.lazarus-ide.org> wrote:
>>
>>> On gtk2 it calls TGtk2WidgetSet.CreateTimer, which calls gtk_timeout_add()
>>> I cannot find in inet, about max number of 'timeouts' in gtk2.
>>>
>>> Alexey
>>
>> I am using:
>> LCLWidgetType:=nogui
>>
>> This is a console program, which I guess I should have stated in my
>> thread subject...
>
>The NoGUI widgetset does not support timers:
>
>function TNoGUIWidgetSet.CreateTimer(Interval: integer; TimerFunc: TWSTimerProc
>   ): THandle;
>begin
>   Result:=0;
>end;
>
>function TNoGUIWidgetSet.DestroyTimer(TimerHandle: THandle): boolean;
>begin
>   Result:=false;
>end;
>
>As I stated many times before: DO NOT use the nogui widgetset.
>It is a basically flawed concept.
>
>Create a normal console appliation instead and use the fpTimer unit if you
>need a timer.
>
>Michael.

OK,
so I created this program as a simple program with no template.
In Delphi it was a TService descendant, but now i want it to just be a
normal console program, which I can run as a service under Systemd on
Linux.

Then while chasing a strange error concerning wsmenus I changed from
what it was in the beginning to nogui.

Now I do not know how to cancel that change and get back to what it
was before (it needs to be a console app and dual platform).

There 13 different "widgets" offered and I do not remember what it was
in the beginning. So which do I choose for a dual platform
(Linux/Windows) application?

Concerning timers the old application I am porting makes heavy use of
TTimer objects, there are probably a lot more than the 4 I have in
this constructor.

So I should change the timer class from TTimer to TfpTimer or some
such?

I assume that is cross-platform, right?


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list