Changeset 1767 for branches/alma
- Timestamp:
- 07/14/10 14:14:52 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/interactivemask.py
r1724 r1767 200 200 'pixel': [event.x, event.y, 201 201 event.x, event.y]} 202 ### Start mod: 2009/08/17 kana ###203 #self._default_motion('stop')204 ### End mod ######################205 202 self.p._plotter.register('motion_notify', self._region_draw) 206 203 self.p._plotter.register('button_release', self._region_end) … … 220 217 221 218 self.p._plotter.figmgr.toolbar.draw_rubberband(event, xnow, ynow, self.rect['x'], self.rect['y']) 222 ### Start mod: 2009/08/17 kana ###223 #self.p._plotter.figmgr.toolbar.mouse_move(event)224 ### End mod ######################225 219 226 220 def _region_end(self,event): 227 221 self.p._plotter.register('motion_notify', None) 228 ### Start mod: 2009/08/17 kana ###229 #self._default_motion('start')230 ### End mod ######################231 222 self.p._plotter.register('button_release', None) 232 223 224 # Delete the rubber band 233 225 self.p._plotter.figmgr.toolbar.release(event) 234 226 … … 312 304 self.p._plotter.canvas.draw() 313 305 314 ### Start mod: 2009/08/17 kana ###315 def _default_motion(self,action):316 if not isinstance(action,str):317 print "WARN: Either 'stop' or 'start' is valid."318 return319 320 canvas=self.p._plotter.canvas321 toolbar=self.p._plotter.figmgr.toolbar322 if action == 'stop':323 if toolbar._idDrag:324 print "WARN: No default event. Nothing to be done."325 return326 canvas.mpl_disconnect(toolbar._idDrag)327 print "Disconnecting default motion event ", toolbar._idDrag328 elif action == 'start':329 if toolbar._idDrag:330 print "WARN: Default event already exists. Disconnecting the event."331 canvas.mpl_disconnect(toolbar._idDrag)332 toolbar._idDrag=canvas.mpl_connect('motion_notify_event',toolbar.mouse_move)333 print "Connecting default motion event ", toolbar._idDrag334 else:335 print "WARN: Either 'stop' or 'start' is valid."336 337 ### End mod ######################338 339 306 def finish_selection(self, callback=None): 340 307 """
Note:
See TracChangeset
for help on using the changeset viewer.