I need to display a context menu whenever a tab is clicked on and it needs to react to that specific tab. Is there any way to do this without subclassing it?
Easy way, but possibly not precisely what you need:
This will get a function called whenever the tab is changed (not necessarily clicked) and spawn a menu at the current mouse position.
Complicated way, which exactly does what you describe: