class_docstr: Two dimensional buffer of :class:`.Char` instances.
docstr: Get the menu position for a given window.
  (This falls back to the cursor position if no menu position was set.)
docstr_tok: ["Get","the","menu","position","for","a","given","window",".","(","This","falls","back","to","the","cursor","position","if","no","menu","position","was","set",".",")"]
code: def get_menu_position(self, window: Window) -> Point:
      """
      Get the menu position for a given window.
      (This falls back to the cursor position if no menu position was set.)
      """
      try:
          return self.menu_positions[window]
      except KeyError:
          try:
              return self.cursor_positions[window]
          except KeyError:
              return Point(x=0, y=0)
  
imports: from __future__ import annotations
  from collections import defaultdict
  from typing import TYPE_CHECKING, Callable
  from prompt_toolkit.cache import FastDictCache
  from prompt_toolkit.data_structures import Point
  from prompt_toolkit.utils import get_cwidth
label_desc: Use image node_id 6 for calling the Screen obj's underlying member method code with example usage: obj.get_menu_position(window) and returns: self, self, Point