This function is not really wxBookCtrl-specific and can be used with other classes as well, so allow reusing it in them. No real changes, this is just a refactoring.