def _reposition_choices(self, force=False):
        # remove this line to have auto-completion window almost
        # always visible. I can't decide -- automatic, or only
        # on control-space.
        if not force and not self.complete_frame.winfo_viewable():
            return

        try:
            bbox = self.bbox("current_cell.first")
        except Exception, e:
            return
        fx = bbox[0]
        fy = bbox[1] + bbox[3] + 2
        yoffset = 2
        listheight = self.complete_frame.winfo_reqheight()
        if fy+listheight > self.winfo_height():
            # won't fit below; go to plan B!
            fy = bbox[1]-(listheight+ yoffset)
            if fy < 1:
                # crap! won't fit above either. Screw it. Show it
                # below and let the user suffer the consequences.
                fy = bbox[1] + bbox[3] + yoffset
        # print "   fx/fy:", fx,fy
        # print "  height:", self.winfo_height()
        # print "       reqheight of frame:", self.complete_frame.winfo_reqheight()
        # print "   actual height of frame:", self.complete_frame.winfo_height()
        self.complete_frame.place(x=fx, y=fy)
dataset/ETHPy150Open boakley/robotframework-workbench/rwb/widgets/dte.py/DynamicTableEditor._reposition_choices/original