Forum > QT

[solved] Imagelist of popup menu is not updated at runtime

(1/2) > >>

Ocye:
I use an imagelist to show icons with popup menu items. When the content of the imagelist is modified at runtime (delete/insert) these changes are not applied to the menu. The imagelist contains the new picture - a simple GetBitmap() and Draw() works well. But how can I update the popup menu?

Tested with Qt for Linux and Darwin (and successfully with Gtk2 and win32/64).

PS: A simple PopupMenu.Images:=nil; ImageList.Delete/Insert; PopupMenu.Images:ImageList; does the trick.

Dibo:

--- Quote from: Ocye on September 15, 2012, 11:29:13 am ---PS: A simple PopupMenu.Images:=nil; ImageList.Delete/Insert; PopupMenu.Images:ImageList; does the trick.

--- End quote ---
Yes. I got the same problem with TListView long time ago and this same trick solved problem. But I reported it on bug tracker and it is fixed now. PopMenu probably has same bug with cache.

Ocye:
Maybe it's not a LCL bug but a Qt feature  :o

zeljko:
Please open an issue about it and attach example.

Ocye:

--- Quote from: zeljko on September 15, 2012, 09:50:23 pm ---Please open an issue about it and attach example.

--- End quote ---
done (http://bugs.freepascal.org/view.php?id=22896)

Navigation

[0] Message Index

[#] Next page

Go to full version