There is no reason not to allow calling this function with const window, so do allow it, notably to make it possible to use it with "this" from const wxWindow methods.