How can I create a custom popup menu and how to show that in the palette and context pad

How can I create a custom popup menu and how to show that in the palette and context pad?

Thanks in advance for any help

Hello!
Please provide more information of what you are trying to do (ideally with some screenshots)