def create_pixmap(conn, wid, width, height):
    """Creates a window of the given dimensions and returns the XID"""
    pixmap = conn.generate_id()
    default_screen = conn.setup.roots[conn.pref_screen]

    conn.core.CreatePixmap(
        default_screen.root_depth,  # depth
        pixmap, wid,                # pixmap id, drawable id (window)
        width, height
    )

    return pixmap