def FindPaneInDock(dock, window):
    """
    FindPaneInDock() looks up a specified window pointer inside a dock.
    If found, the corresponding PaneInfo pointer is returned, otherwise None.
    """

    for p in dock.panes:
        if p.window == window:
            return p
    
    return None