r9779: Add a contextmenu function to be used by all window/widget objects.