Added "generate_context_menu" function for when an element wants to create a context menu.