def set_pos(win, cfg):
    """Restore a window to a position from the registry"""
    xpos = cfg.ReadInt('xpos', -1)
    ypos = cfg.ReadInt('ypos', -1)
    width = cfg.ReadInt('width', -1)
    height = cfg.ReadInt('height', -1)
    win.SetDimensions(xpos, ypos, width, height)
Restore a window to a position from the registry
recipes/Python/409012_A_Simple_ZODB_viewer_in_wxPython/recipe-409012.py