Add onShow and onHide callback options

Can be used, for example, to customise the content of the the menu bar
by tweaking the HTML.