def METHOD_NAME(self, window: bauiv1.Widget) -> None:
    """Set the current 'main' window, replacing any existing."""
    existing = self._main_menu_window
    from inspect import currentframe, getframeinfo
    # Let's grab the location where we were called from to report
    # if we have to force-kill the existing window (which normally
    # should not happen).
    frameline = None
    try:
        frame = currentframe()
        if frame is not None:
            frame = frame.f_back
        if frame is not None:
            frameinfo = getframeinfo(frame)
            frameline = f'{frameinfo.filename} {frameinfo.lineno}'
    except Exception:
        logging.exception('Error calcing line for set_main_menu_window')
    # With our legacy main-menu system, the caller is responsible for
    # clearing out the old main menu window when assigning the new.
    # However there are corner cases where that doesn't happen and we get
    # old windows stuck under the new main one. So let's guard against
    # that. However, we can't simply delete the existing main window when
    # a new one is assigned because the user may transition the old out
    # *after* the assignment. Sigh. So, as a happy medium, let's check in
    # on the old after a short bit of time and kill it if its still alive.
    # That will be a bit ugly on screen but at least should un-break
    # things.
    def _delay_kill() -> None:
        import time
        if existing:
            print(
                f'Killing old main_menu_window'
                f' when called at: {frameline} t={time.time():.3f}'
            )
            existing.delete()
    babase.apptimer(1.0, _delay_kill)
    self._main_menu_window = window