def _locate_place_point( self ) :
        """internal routine to calculate where to place a window
        returns a tuple( x, y, anchor ) where x, y are
        the window corner and anchor is the anchor"""
        # get the details of the button activating this menu
        bw = self.button.winfo_width()
        bh = self.button.winfo_height()
        bx = int( self.button.winfo_rootx() )
        by = int( self.button.winfo_rooty() )
        rx = int( self._root.winfo_rootx() )
        ry = int( self._root.winfo_rooty() )

        # work out the cumulative size of the borders of the menu to post
        # plus its parent menus
        border = self._menu_frame_kw.get( 'borderwidth', 0 )
        border += self._root.cget( 'borderwidth' )
        if self._parent is not None :
            border += self._parent._menu_frame_kw.get( 'borderwidth', 0 )

        if not self._is_submenu :
            # for the top level, the menu is aligned from the main
            # button and directly below
            y = bh + by - ry + border     # south
            if self._cascade_side == RIGHT :
                x = bx - rx - border      # west
                anchor = NW
            else :
                x = bx - rx + bw + border # east
                anchor = NE
        else :
            # submenu, build to one side of the button causing this
            # menu to be posted
            y = by - ry           # north
            if self._cascade_side == LEFT :
                x = bx - rx - border
                anchor = NE
            else :
                x = bw + bx - rx  + border
                anchor = NW

        # save root dimensions for later
        self._rx = rx
        self._ry = ry
        self._root_geom = root.winfo_geometry()
        self._self_geom = self.button.winfo_geometry()
        return ( x, y, anchor )
internal routine to calculate where to place a window
        returns a tuple( x, y, anchor ) where x, y are
        the window corner and anchor is the anchor
recipes/Python/442500_ExtraMenu__TkInter_menu_arbitrary_widgets/recipe-442500.py