Example #1
0
    def ginput(self, n=1, timeout=30, show_clicks=True):
        """
        call signature::

          ginput(self, n=1, timeout=30, show_clicks=True)

        Blocking call to interact with the figure.

        This will wait for *n* clicks from the user and return a list of the
        coordinates of each click.

        If *timeout* is zero or negative, does not timeout.

        If *n* is zero or negative, accumulate clicks until a middle click
        (or potentially both mouse buttons at once) terminates the input.

        Right clicking cancels last input.

        The keyboard can also be used to select points in case your mouse
        does not have one or more of the buttons.  The delete and backspace
        keys act like right clicking (i.e., remove last point), the enter key
        terminates input and any other key (not already used by the window
        manager) selects a point.
        """

        blocking_mouse_input = BlockingMouseInput(self)
        return blocking_mouse_input(n=n,
                                    timeout=timeout,
                                    show_clicks=show_clicks)
Example #2
0
    def ginput(self,
               n=1,
               timeout=30,
               show_clicks=True,
               mouse_add=1,
               mouse_pop=3,
               mouse_stop=2):
        """
        call signature::

          ginput(self, n=1, timeout=30, show_clicks=True,
                 mouse_add=1, mouse_pop=3, mouse_stop=2)

        Blocking call to interact with the figure.

        This will wait for *n* clicks from the user and return a list of the
        coordinates of each click.

        If *timeout* is zero or negative, does not timeout.

        If *n* is zero or negative, accumulate clicks until a middle click
        (or potentially both mouse buttons at once) terminates the input.

        Right clicking cancels last input.

        The buttons used for the various actions (adding points, removing
        points, terminating the inputs) can be overriden via the
        arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
        the associated mouse button: 1 for left, 2 for middle, 3 for
        right.

        The keyboard can also be used to select points in case your mouse
        does not have one or more of the buttons.  The delete and backspace
        keys act like right clicking (i.e., remove last point), the enter key
        terminates input and any other key (not already used by the window
        manager) selects a point.
        """

        blocking_mouse_input = BlockingMouseInput(self,
                                                  mouse_add=mouse_add,
                                                  mouse_pop=mouse_pop,
                                                  mouse_stop=mouse_stop)
        return blocking_mouse_input(n=n,
                                    timeout=timeout,
                                    show_clicks=show_clicks)
Example #3
0
    def ginput(self, n=1, timeout=30, show_clicks=True):
        """
        call signature::

          ginput(self, n=1, timeout=30, show_clicks=True)

        Blocking call to interact with the figure.

        This will wait for *n* clicks from the user and return a list of the
        coordinates of each click.

        If *timeout* is negative, does not timeout.

        If *n* is negative, accumulate clicks until a middle click
        terminates the input.

        Right clicking cancels last input.
        """

        blocking_mouse_input = BlockingMouseInput(self)
        return blocking_mouse_input(n=n, timeout=timeout,
                                    show_clicks=show_clicks)