Permalink
Browse files

Unified reset code

  • Loading branch information...
1 parent 2f5e1e2 commit dd896a948642f76e94009786658317844c69e81b @sjagoe committed Jun 11, 2012
Showing with 7 additions and 8 deletions.
  1. +6 −0 pikos/live/ui/base_view.py
  2. +0 −6 pikos/live/ui/cprofile_view.py
  3. +1 −2 pikos/live/ui/memory_view.py
@@ -40,6 +40,12 @@ class BaseView(ModelView):
# Handlers
+ def _reset_view_button_fired(self):
+ self.plot.x_mapper.range.low_setting = 'auto'
+ self.plot.x_mapper.range.high_setting = 'auto'
+ self.plot.y_mapper.range.low_setting = 'auto'
+ self.plot.y_mapper.range.high_setting = 'auto'
+
@on_trait_change('model.updated')
def _model_updated(self):
self.plot.invalidate_and_redraw()
@@ -95,12 +95,6 @@ def _on_model_plot_keys_changed(self):
# Handlers
- def _reset_view_button_fired(self):
- self.plot.x_mapper.range.low_setting = 'auto'
- self.plot.x_mapper.range.high_setting = 'auto'
- self.plot.y_mapper.range.low_setting = 'auto'
- self.plot.y_mapper.range.high_setting = 'auto'
-
def _sort_values_button_fired(self):
self.model.sort_by_current_value()
self.plot.invalidate_and_redraw()
@@ -67,8 +67,7 @@ def _plot_default(self):
def _reset_view_button_fired(self):
self.follow_plot = False
- self.plot.x_mapper.range.low_setting = 'auto'
- self.plot.x_mapper.range.high_setting = 'auto'
+ super(MemoryView, self)._reset_view_button_fired()
def _metadata_changed(self, new):
data_indices = self.scatter.index.metadata.get('selections', [])

0 comments on commit dd896a9

Please sign in to comment.