Ñò ÝšJc @ sˆ d Z d d k l Z l Z d d k l Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( s This provides several classes used for blocking interaction with figure windows: :class:`BlockingInput` creates a callable object to retrieve events in a blocking way for interactive sessions :class:`BlockingKeyMouseInput` creates a callable object to retrieve key or mouse clicks in a blocking way for interactive sessions. Note: Subclass of BlockingInput. Used by waitforbuttonpress :class:`BlockingMouseInput` creates a callable object to retrieve mouse clicks in a blocking way for interactive sessions. Note: Subclass of BlockingInput. Used by ginput :class:`BlockingContourLabeler` creates a callable object to retrieve mouse clicks in a blocking way that will then be used to place labels on a ContourSet Note: Subclass of BlockingMouseInput. Used by clabel iÿÿÿÿ( t patht verbose( t is_sequence_of_stringst BlockingInputc B sq e Z d Z d d „ Z d „ Z d „ Z d „ Z d „ Z d d „ Z d d „ Z e i e _ d d d „ Z RS( sX Class that creates a callable object to retrieve events in a blocking way. c C s | | _ | | _ d S( N( t figt eventslist( t selfR R ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyt __init__ s c C sr | i | ƒ t i d t | i ƒ ƒ | i ƒ t | i ƒ | i j o$ | i d j o | i i i ƒ n d S( se Event handler that will be passed to the current figure to retrieve events. s Event %ii N( t add_eventR t reportt lent eventst post_eventt nR t canvast stop_event_loop( R t event( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyt on_event! s )c C s d S( s, For baseclass, do nothing but collect eventsN( ( R ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyR 4 s c C s4 x$ | i D] } | i i i | ƒ q Wg | _ d S( s Disconnect all callbacksN( t callbacksR R t mpl_disconnect( R t cb( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyt cleanup8 s c C s | i i | ƒ d S( s5 For base class, this just appends an event to events.N( R t append( R R ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyR ? s iÿÿÿÿc C s | i i | ƒ d S( s' This removes an event from the event list. Defaults to removing last event, but an index can be supplied. Note that this does not check that there are events, much like the normal pop method. If not events exist, this will throw an exception. N( R t pop( R t index( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyt pop_eventC s c C s | i | ƒ d S( N( R ( R R ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyR M s i i c C s | | _ g | _ g | _ | i i ƒ x6 | i D]+ } | i i | i i i | | i ƒ ƒ q2 Wz | i i i d | ƒ Wd | i ƒ X| i S( s4 Blocking call to retrieve n events t timeoutN( R R R R t showR R R t mpl_connectR t start_event_loopR ( R R R ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyt __call__Q s )( ( t __name__t __module__t __doc__R R R R R R R R ( ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyR s t BlockingMouseInputc B s§ e Z d Z d Z d Z d Z d d d d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d d „ Z d d „ Z d d „ Z d d e d „ Z RS( s; Class that creates a callable object to retrieve mouse clicks in a blocking way. This class will also retrieve keyboard clicks and treat them like appropriate mouse clicks (delete and backspace are like mouse button 3, enter is like mouse button 2 and all others are like mouse button 1). i i i c C s8 t i | d | d d ƒ| | _ | | _ | | _ d S( NR R t button_press_eventt key_press_event( R# R$ ( R R t button_addt button_popt button_stop( R R t mouse_addt mouse_popt mouse_stop( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyR { s c C s3 | i d i d j o | i ƒ n | i ƒ d S( s7 This will be called to process events iÿÿÿÿR$ N( R t namet key_eventt mouse_event( R ( ( s? /usr/lib64/python2.6/site-packages/matplotlib/blocking_input.pyR … s c C si | i d } | i } | | i j o | i | ƒ n/ | | i j o | i | ƒ n | i | ƒ d S( s Process a mouse click eventiÿÿÿÿN( R t buttonR&