Recent

Author Topic: FPGui fpgApplication onidle  (Read 328 times)

relocate

  • New Member
  • *
  • Posts: 22
FPGui fpgApplication onidle
« on: November 23, 2022, 07:26:03 am »
Allthough not many people may use it, may be someone can help.

I set my method to the onidle of the fpgapplication (which is set as TNotifyEvent) but the program doesn't call it.
May be I missing something. Has anyone done this so far?

Regards relocate
OS, Lazarus, FPC: Win (no Lazarus, FPC 2.4.4) | CPU-Target: 32Bit

Thaddy

  • Hero Member
  • *****
  • Posts: 12971
Re: FPGui fpgApplication onidle
« Reply #1 on: November 23, 2022, 08:02:21 am »
It should be called, unless! the application's main thread contains a loop in such a way that it never idles.
Note that I have not used fpGui for a quite a long time - I really should use it more - but afaicr it worked at least under linux 64 (Debian flavors)
We need to have some sourcecode that replicates this
We also need to know which platform, OS, CPU, bitness, versions. "It doesn't work" is not very informative.
« Last Edit: November 23, 2022, 08:35:05 am by Thaddy »
I actually get compliments for being rude... (well, Dutch, but that is the same)

relocate

  • New Member
  • *
  • Posts: 22
Re: FPGui fpgApplication onidle
« Reply #2 on: November 23, 2022, 08:53:23 am »
I also thought it would work, but it doesn't.
I only found a discussions from Graeme how to implement onidle, unfortunately no example on how to use it.

https://fpc-pascal.freepascal.narkive.com/6NGBhmE2/timer-in-x11

Windows 64bit (CPU:Intel, how could this help it should run on any CPU, so far).
I use the last Stable/Maint Version of FPGui (1.4) and at the moment FPC 2.6.4 (I think this shouldn't be the problem).

I'm only using FPC and FPGui not Lazarus.

I hope this is enough

Code: Pascal  [Select][+][-]
  1. procedure TMainForm.NoteMe(Sender:TObject);
  2. begin
  3.   writeln('Not busy');
  4. end;
  5.  
  6. procedure TMainForm.AfterCreate;
  7. begin
  8.   Name := 'Test';
  9.   SetPosition(376, 600, 800, 600);
  10.   WindowTitle := 'Test';
  11.   Hint := '';
  12.   WindowPosition := wpScreenCenter;
  13.   fpgApplication.OnIdle := @NoteMe;
  14. end;
  15.  
  16. var frm: TMainForm;
  17.  
  18. begin
  19.   frm := TMainForm.Create(nil);
  20.   fpgApplication.Initialize;
  21.   try
  22.     frm.Show;
  23.     fpgApplication.Run;
  24.   finally
  25.     frm.Free;
  26.   end;
  27. end.
OS, Lazarus, FPC: Win (no Lazarus, FPC 2.4.4) | CPU-Target: 32Bit

 

TinyPortal © 2005-2018