TrayIcon MenuItem Caption not updated lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- dbannon · 2017-10-04 01:52 Hi, not sure if this should be posted under LCL or MacOSX. But here goes- Under OSX (but not Linux or Windows) a MenuItem belonging to a PopupMenu associated with a TrayIcon cannot be updated at run time. Easy to reproduce - On a clean form, drop a TrayIcon, a PopupMenu and, for logging, a TMemo. Set the trayicon's popupmenu property to the popupmenu, add a menu item to the popupmenu. Show the trayicon (with OnShow or a button) and add a button that does this - Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1.Click(Sender: TObject);begin    MenuItem1.Caption := 'I changed this';    Memo1.Append(MenuItem1.caption);end; You will see what you expect in the memo, "I changed this" but click the TrayIcon and the menu text displayed is still "MenuItem1". The caption itself is being changed but apparently noone is telling the PopupMenu. Changing caption at design time works perfectly. This all works fine under Windows and Linux. Is there any reason why I should not log it as a bug ? Under Lazarus Packages ? Lazarus 1.8RC4, Mac OSX Sierra. David ---------------------------------------------------------------------- Hansaplast · 2017-10-04 15:32 I ran into a similar problem, and used internalupdate() for that, which worked in my case: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TrayIcon.InternalUpdate; In my case I restructured the menu on the fly, which didn't take, but after calling the InternalUpdate function, the menu did get updated. Hope this helps. ---------------------------------------------------------------------- dbannon · 2017-10-05 01:44 yep, you are right Hans, thanks. I was looking for something to do that in the PopUpMenu itself. But clearly, a TrayIcon issue. I'll put a note on the wiki. Still sounds like a bug to me, think I'll also log it on the bug tracker. Thanks David ---------------------------------------------------------------------- dbannon · 2017-10-06 09:10 Logged - issue 32516 ---------------------------------------------------------------------- Hansaplast · 2017-10-07 20:48 Hi David, glad to hear that worked for you, and thanks for creating a bug report. I guess I could have thought of that myself at the time.