How to customize style of TMainMenu and TPopupMenu? lazarus / 31-LCL ---------------------------------------------------------------------- tu · 2024-11-24 13:17 I want to customize styles of TMainMenu and TPopupMenu, eg: changing menu item color. But it seems TMainMenu and TPopupMenu are OS-dependent. I used OwnerDraw with customized OnDrawItem and OnDrawItem but it works only on Windows. I want to customize menu styles which support cross-platform: Windows, macOS (Cocoa) and Linux (QT, GTK). Is it possible to do that? Thank you so much, ---------------------------------------------------------------------- Handoko · 2024-11-24 13:24 You can easily write your own popup menu. For example this is my popup with listbox in the User Interface section in the link below: https://wiki.freepascal.org/Portal:HowTo_Demos#User_Interface For TMainMenu, I still have no idea. ---------------------------------------------------------------------- LV · 2024-11-24 19:14 Maybe make MainMenu something like this? Tested on both Windows 11 and Linux(gtk2). Please take a look at the attached project. ---------------------------------------------------------------------- Handoko · 2024-11-24 19:21 Nice! But things will become complicated if we need sub menus. ---------------------------------------------------------------------- tu · 2024-11-26 13:15 It seems does not have any easy way to custom menu. Thank you so much One more question. Is there any solution (built-in component, external libraries...) to custom draw menu? ---------------------------------------------------------------------- TRon · 2024-11-26 13:22 A quick search revealed this thread and it seem to be manual labour. ---------------------------------------------------------------------- tu · 2024-11-27 02:21 Quote from: TRon on November 26, 2024, 02:22:44 pmA quick search revealed this thread and it seem to be manual labour. It seems OwnerDraw and OnDrawItem work only on Windows. I tested with Linux GTK and QT but OnDrawItem() has no effect. I think have to use self-draw control or using another control to simulate popup menu. ---------------------------------------------------------------------- TRon · 2024-11-28 02:13 Ah, shoot ! I forgot  Yes, indeed tu, I'm sorry.