* * *

Author Topic: TTrayIcon doesn't hear Click events  (Read 2667 times)

rajivsoft

  • New member
  • *
  • Posts: 48
TTrayIcon doesn't hear Click events
« on: March 08, 2011, 12:58:39 pm »
TTrayIcon doesn't hear any of click events (OnClick, OnDblClick, OnMouseDown) neither when you assign events via ObjectInspector nether in Programmatically way.
Con you confirm this? (in example project there must be a messagebox when you click on trayicon)

Dibo

  • Hero Member
  • *****
  • Posts: 1044
Re: TTrayIcon doesn't hear Click events
« Reply #1 on: March 08, 2011, 01:11:52 pm »
I had this problem only on GTK and only with -dUseStatusIcon switch. But OnMouseDown works fine and I am using this event instead of OnClick

rajivsoft

  • New member
  • *
  • Posts: 48
Re: TTrayIcon doesn't hear Click events
« Reply #2 on: March 08, 2011, 01:42:37 pm »
I had this problem only on GTK and only with -dUseStatusIcon switch. But OnMouseDown works fine and I am using this event instead of OnClick
I'm using Carbon with MacOS X 10.6

DinuX

  • New member
  • *
  • Posts: 6
Re: TTrayIcon doesn't hear Click events
« Reply #3 on: July 07, 2017, 12:58:24 pm »
Very old topic, but same problem.

lazarus 1.6.4
macOS Sierra 10.12.5

TTrayIcon events (OnClick, OnDblClick, OnMouseDown) not working. Works only PopUpMenu, but when it shows, Menu events also does not work.

On Windows same code works as expected.

Handoko

  • Hero Member
  • *****
  • Posts: 1326
  • My goal: build my own game engine using Lazarus
Re: TTrayIcon doesn't hear Click events
« Reply #4 on: July 07, 2017, 01:04:19 pm »
I used TTrayIcon on one of my small utilities, so far working good on Linux64 GTK2. Can you provide a simple demo for me to test?

DinuX

  • New member
  • *
  • Posts: 6
Re: TTrayIcon doesn't hear Click events
« Reply #5 on: July 11, 2017, 06:09:42 pm »
Uploaded my code here http://www.dinux.lt/share/icon_test.zip

Code is very simple, just form, trayicon and one button. TrayIcon and Button onclick shows "hello" message.
On windows it works.
On archlinux it works.
On OSX works only button, TrayIcon do not react to click.

DinuX

  • New member
  • *
  • Posts: 6
Re: TTrayIcon doesn't hear Click events
« Reply #6 on: July 17, 2017, 05:55:02 pm »
Found solution. Just need change LCL Widget Type from 'carbon' to 'cocoa'. And now it works as expected.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus