wxNotebook and right mouse click

it's possible to implement the right mouse click with wxNotebbok?
I need to append a popupo menu on right click on one of the notebook tabs

and at the same

change the notebook selection on the item right-clicked

The only way i have figured out how to do this (on Windows) is to use fixed
width tabs,
catch the raw mouse event, and calculate which tab the mouse is over using
the x
coordinate of the mouse click. Probably obvious but note that this only
works if there are
fewer tabs than the notebook's width so that there are no tab scrollbars.