Esempio n. 1
0
    def is_inside_box(self, x, y):
        """Returns whether the point (x,y) is inside the menu item.

        :rtype: bool
        """
        #        (ax, ay, bx, by) = self.get_box()
        #        if( x >= ax and x <= bx and y >= ay and y <= by ):
        #            return True
        #        return False
        rect = self.get_box()
        p = self.point_to_local((x, y))
        return rect.contains(p.x, p.y)
Esempio n. 2
0
    def is_inside_box(self, x, y):
        """Returns whether the point (x,y) is inside the menu item.

        :rtype: bool
        """
#        (ax, ay, bx, by) = self.get_box()
#        if( x >= ax and x <= bx and y >= ay and y <= by ):
#            return True
#        return False
        rect = self.get_box()
        p = self.point_to_local((x, y))
        return rect.contains(p.x, p.y)