Ignore:
Timestamp:
08/21/06 10:48:45 (18 years ago)
Author:
mar637
Message:

lots of changes to support soft refresh, for things like text overlays, linecatlogs etc. reworked plot_lines to to auto-peak detection. added forwarding functions to matplotlib.axes. drawing functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotgui_gtk.py

    r1089 r1153  
    88import matplotlib
    99from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
     10from matplotlib.backends.backend_gtkagg import FigureManagerGTKAgg
    1011matplotlib.use("GTkAgg")
    1112matplotlib.rcParams['toolbar'] = 'toolbar2'
     13from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as NavigationToolbar
    1214
    1315class asaplotgui(asaplotbase):
     
    2729
    2830        asaplotbase.__init__(self, **v)
    29         self.window = gtk.Window()
     31        matplotlib.interactive = True
     32        self.canvas = FigureCanvas(self.figure)
     33        # Simply instantiating this is enough to get a working toolbar.
     34        self.figmgr = FigureManagerGTKAgg(self.canvas, 1)
    3035        def dest_callback(val):
    3136            self.is_dead = True
    32             self.window.destroy()
     37            self.figmgr.window.destroy()
     38        self.window = self.figmgr.window
    3339        self.window.connect("destroy", dest_callback )
    34         self.window.set_default_size(800,600)
    35         self.subwin = gtk.ScrolledWindow()
    36         self.window.add(self.subwin)
    37         self.subwin.set_border_width(10)
    38         self.canvas = FigureCanvas(self.figure)
    39         # Simply instantiating this is enough to get a working toolbar.
    40         self.figmgr = None#FigureManagerTkAgg(self.canvas, 1, self.window)
    41         self.window.set_title('ASAPlot graphics window')
    42 
     40        self.window.set_title('ASAP Plotter - GTK')
    4341        self.events = {'button_press':None,
    4442                       'button_release':None,
    4543                       'motion_notify':None}
    4644
    47         self.subwin.add_with_viewport(self.canvas)
    48         matplotlib.interactive = True
    4945        self.buffering = buffering
    50         self.canvas.set_size_request(800,600)
    51 
    52         self.canvas.show()
     46        matplotlib.rcParams['interactive'] = True
     47        #self.canvas.set_size_request(800,600)
     48
     49        #self.canvas.show()
    5350
    5451    def map(self):
     
    180177
    181178
    182     def show(self):
     179    def show(self, hardrefresh=True):
    183180        """
    184181        Show graphics dependent on the current buffering state.
    185182        """
    186183        if not self.buffering:
    187             asaplotbase.show(self)
     184            if hardrefresh:
     185                asaplotbase.show(self, hardrefresh)
    188186            self.window.deiconify()
    189187            self.canvas.draw()
Note: See TracChangeset for help on using the changeset viewer.