Changeset 1620 for branches/alma


Ignore:
Timestamp:
08/15/09 19:00:32 (15 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No

Ready to Release: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s):

Description:

Modified some lines to make the code backend independent.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/python/asaplotbase.py

    r1614 r1620  
    298298
    299299        def region_start(event):
    300             height = self.canvas.figure.bbox.height()
    301             self.rect = {'fig': None, 'height': height,
    302                          'x': event.x, 'y': height - event.y,
     300            self.rect = {'x': event.x, 'y': event.y,
    303301                         'world': [event.xdata, event.ydata,
    304302                                   event.xdata, event.ydata]}
     
    308306
    309307        def region_draw(event):
    310             self.canvas._tkcanvas.delete(self.rect['fig'])
    311             self.rect['fig'] = self.canvas._tkcanvas.create_rectangle(
    312                                 self.rect['x'], self.rect['y'],
    313                                 event.x, self.rect['height'] - event.y)
    314 
     308            self.figmgr.toolbar.draw_rubberband(event, event.x, event.y,
     309                                                self.rect['x'], self.rect['y'])
     310           
    315311        def region_disable(event):
    316312            self.register('motion_notify', None)
    317313            self.register('button_release', None)
    318 
    319             self.canvas._tkcanvas.delete(self.rect['fig'])
    320314
    321315            self.rect['world'][2:4] = [event.xdata, event.ydata]
     
    323317                self.rect['world'][1], self.rect['world'][2],
    324318                self.rect['world'][3])
     319            self.figmgr.toolbar.release(event)
    325320
    326321        self.register('button_press', region_start)
Note: See TracChangeset for help on using the changeset viewer.