Recent

Author Topic: [CLOSED] Trayicon  (Read 2447 times)

pcurtis

  • Hero Member
  • *****
  • Posts: 748
[CLOSED] Trayicon
« on: October 06, 2021, 07:25:50 am »
Does anyone know how to change the Balloon timeout in the trayicon component?

It doesnt seem to work
« Last Edit: October 12, 2021, 09:43:59 am by pcurtis »
Windows 10
Laz 2.0.10
FPC 3.2.0

loaded

  • Sr. Member
  • ****
  • Posts: 378
Re: Trayicon
« Reply #1 on: October 06, 2021, 02:27:08 pm »
I do not know why ; if visibility is on, the timeout stays fixed. But disabling this visibility causes the timeout to work properly.
Code: Pascal  [Select][+][-]
  1. TrayIcon1.Visible:=false;
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

pcurtis

  • Hero Member
  • *****
  • Posts: 748
Re: Trayicon
« Reply #2 on: October 06, 2021, 06:00:56 pm »
Thanks.

Nope thats not it, and when visibility:=false the balloon dialogue is missing
« Last Edit: October 06, 2021, 06:15:17 pm by pcurtis »
Windows 10
Laz 2.0.10
FPC 3.2.0

dietmar

  • Full Member
  • ***
  • Posts: 170
Re: Trayicon
« Reply #3 on: October 08, 2021, 12:53:18 pm »
Yep, the "floating balloon" coming from right to left seems only to work with visibility set to true...

--Dietmar
 
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

loaded

  • Sr. Member
  • ****
  • Posts: 378
Re: Trayicon
« Reply #4 on: October 11, 2021, 01:54:23 pm »
I was showing the errors that occurred while operating in the database via the trayicon. However, when more than one error occurred, an undesirable situation like this one occurred. After doing some research on the subject;
https://stackoverflow.com/a/26548309  Based on relevant information.
 

Doesn't fix the timeout issue!
But it does the simultaneous balloon display without any problems.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   TButton(Sender).Caption:=inttostr(GetTickCount);
  4.   TrayIcon1.Visible:= false; //
  5.   TrayIcon1.Visible:= true;  // close and open usually works, it works here as well.
  6.  
  7.   TrayIcon1.BalloonTitle:='Real Time';
  8.   TrayIcon1.BalloonFlags:=bfInfo;
  9.   TrayIcon1.BalloonHint:=TButton(Sender).Caption;
  10.   TrayIcon1.ShowBalloonHint;
  11. end;

My problem is solved, I hope it will work for you too.
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

jamie

  • Hero Member
  • *****
  • Posts: 5047
Re: Trayicon
« Reply #5 on: October 11, 2021, 04:19:43 pm »
looking at the code for this it seems the widget call is by past if a condition is already set so toggling the states tricks this case.

I've seen way too much in the way of ignoring method calls that need to call the widget, but if the local value is already set to the requested value it gets aborted which isn't always a good idea in some cases.

The only true wisdom is knowing you know nothing

loaded

  • Sr. Member
  • ****
  • Posts: 378
Re: Trayicon
« Reply #6 on: October 11, 2021, 06:42:06 pm »
jamie, yes, you may be right, but sometimes things don't go the way you want, then ;
Is it a trick, an idea, a path to the goal? they mingle with each other.
I guess that's one of those situations.
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

 

TinyPortal © 2005-2018