Lazarus

Programming => General => Topic started by: SWM1 on March 23, 2023, 09:07:23 am

Title: [SOLVED] SysTraIcon events do not work.
Post by: SWM1 on March 23, 2023, 09:07:23 am
SysTraIcon events do not work. :o I need to distinguish which mouse key is pressed when clicking on my SysTrayIcon, but not a single event on the SysTrayIcon works. Does anyone have any ideas how to overcome this? Thanks in advance for any help! The menu works, but equally with the right and left mouse button.
PopUpMenuTray.OnPopUp does not work either.  %)
Title: Re: SysTraIcon events do not work.
Post by: KodeZwerg on March 23, 2023, 09:40:31 am
Lazarus 2.3.0 (rev 0d507a4009) FPC 3.2.2 x86_64-win64-win32/win64
Tested under MS Windows 10, 64bit built, no problems, everything works like it should.

What OS / FPC / Lazarus versions you are using?
Title: Re: SysTraIcon events do not work.
Post by: KodeZwerg on March 23, 2023, 09:47:20 am
Attached a minimal demo.
Open project and assign some icon/image to the TTrayIcon component, compile and run.
Title: Re: SysTraIcon events do not work.
Post by: SWM1 on March 23, 2023, 09:47:28 am
Thank you! I have Lazarus 2.2.6. And the Linux Mint 21.1 system. I tried to look at the text of the component - it seems that everything is correct, but for some reason it does not work. Unlike a simple pop-up menu.
Title: Re: SysTraIcon events do not work.
Post by: KodeZwerg on March 23, 2023, 09:55:27 am
Please test my demo and tell if it works like it should.
It should tell what button pressed on a label and only on right click open menu and menu just have one executable entry called exit what close the app.
Title: Re: SysTraIcon events do not work.
Post by: SWM1 on March 23, 2023, 09:56:17 am
Attached a minimal demo.
Open project and assign some icon/image to the TTrayIcon component, compile and run.

 Tried - it doesn't work for me. Ignores events.   :'(
Title: Re: SysTraIcon events do not work.
Post by: KodeZwerg on March 23, 2023, 10:05:50 am
For *nix there are some remarks noted here (https://wiki.freepascal.org/How_to_use_a_TrayIcon#Linux_may_not_display_the_Icon), since I am on Windows I can not help further  :(
Title: Re: SysTraIcon events do not work.
Post by: SWM1 on March 23, 2023, 10:18:11 am
Thank you!
Title: Re: SysTraIcon events do not work.
Post by: SWM1 on March 23, 2023, 02:40:47 pm
I realized that you can't do anything here! This is a limitation for Linux that cannot be overcome.
Thanks again for the link!
TinyPortal © 2005-2018