def getWindowPostition(self): # Code from Tal # https://forum.robofont.com/topic/573/automatic-statusinteractivepopupwindow-positioning if not CurrentGlyphWindow(): return nsWindow = CurrentGlyphWindow().w.getNSWindow() scrollView = CurrentGlyphWindow().getGlyphView().enclosingScrollView() rectInWindowCoords = scrollView.convertRect_toView_(scrollView.frame(), None) rectInScreenCoords = nsWindow.convertRectToScreen_(rectInWindowCoords) (x, y), (w, h) = rectInScreenCoords y = -(y + h) if getGlyphViewDisplaySettings()['Rulers']: offset = 30 else: offset = 10 return x + offset, y + offset