From 4b3f6d6c3016e5dee2ce893f96e1b494842f1e43 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Tue, 24 Jul 2012 00:51:31 -0400 Subject: [PATCH] BUG: in-place add should return object Actually, I didn't mean to add `__iadd__` a couple of commits ago, so this was supposed to be an enhancement that allows you to access `add_widget` using in place adding. --- skimage/viewer/plugins/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skimage/viewer/plugins/base.py b/skimage/viewer/plugins/base.py index 18768530..749d5741 100644 --- a/skimage/viewer/plugins/base.py +++ b/skimage/viewer/plugins/base.py @@ -92,7 +92,7 @@ class Plugin(QtGui.QDialog): def display_filtered_image(self, image): """Override this method to display image on image viewer.""" - pass + self.image_viewer.image = image def _get_value(self, param): return param if not hasattr(param, 'val') else param.val() @@ -112,6 +112,7 @@ class Plugin(QtGui.QDialog): def __iadd__(self, widget): self.add_widget(widget) + return self def update_plugin(self, name, value): setattr(self, name, value)