Recent

Author Topic: TTrayIcon at times do not showing the icon properly. Cannot get ON_PAINT working  (Read 423 times)

Nevada Smith

  • New Member
  • *
  • Posts: 22
I have a strange problem with TTrayIcon which happens only in Linux (XFCE & LXDE). Occasionally the tray icon gets set to an error icon (please see the attachment). Roughly 75% of the time the icon shows up okay, rest of the time the error icon is shown.

I am periodically changing the TrayIcon, although this is not animation.
Code: Pascal  [Select][+][-]
  1. tiMain.Icon.Assign(FTrayProgressIcons[Index + 1].Bitmap);


  • I tried tiMain.ShowIcon:= False; but this seem to do nothing. OnPaint event does not get triggered. Any pointers on how to get OnPaint event get working. Also, how do I invalidate the icon so that OnPaint gets triggered.
  • Alternatively, what is wrong with what I am doing - Icon.Assign? Any tweaks which would get it to work in XFCE & LXDE?
« Last Edit: October 20, 2024, 11:04:54 am by Nevada Smith »

Nevada Smith

  • New Member
  • *
  • Posts: 22
export LAZUSEAPPIND=NO fixed the problem. Now I have to see if I need to use UnityWSCtrls.GlobalUseAppInd as mentioned at https://wiki.freepascal.org/How_to_use_a_TrayIcon..

 

TinyPortal © 2005-2018