diff --git a/fluents/plots.py b/fluents/plots.py index c3f2f77..3498500 100644 --- a/fluents/plots.py +++ b/fluents/plots.py @@ -476,6 +476,14 @@ class Plot (View): pass return ids + + def set_current_selection(self, selection): + """Called whenever the plot should change the selection. + + This method is a dummy method, so that specialized plots that have + no implemented selection can ignore selections alltogether. + """ + pass class LineViewPlot(Plot): """Line view plot with percentiles. @@ -802,18 +810,25 @@ class ImagePlot(Plot): self.ax.set_xticks([]) self.ax.set_yticks([]) self.ax.grid(False) + # FIXME: ax shouldn't be in kw at all if kw.has_key('ax'): kw.pop('ax') # Initial draw -# xim = AxesImage(dataset.asarray(), self.ax) self.ax.imshow(dataset.asarray(), interpolation='nearest', aspect='auto') # Add canvas and show self.add(self.canvas) self.canvas.show() + # Disable selection modes + btn = self._toolbar.get_button('select') + btn.set_sensitive(False) + btn = self._toolbar.get_button('lassoselect') + btn.set_sensitive(False) + self._toolbar.freeze_button.set_sensitive(False) + def get_toolbar(self): return self._toolbar @@ -1285,6 +1300,7 @@ class PlotToolbar(gtk.Toolbar): btn.set_icon_widget(image) btn.connect('toggled', self._on_freeze_toggle) self.insert(btn, -1) + self.freeze_button = btn self.show_all()