From 4a73c1fb3c6735857c91ea882a167f1e898fa480 Mon Sep 17 00:00:00 2001 From: Antonino Ingargiola Date: Wed, 27 Jun 2007 12:45:28 +0200 Subject: [PATCH] Fix imageanalyzer bug when min >= max. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thanks to David Trémouilles for reporting this. --- imageanalyzer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/imageanalyzer.py b/imageanalyzer.py index 187e3bd..7e4c42c 100755 --- a/imageanalyzer.py +++ b/imageanalyzer.py @@ -384,9 +384,14 @@ class ImageApp(GenericMainPlotWindow): def on_applyButton_clicked(self, widget, *args): min = self.minSpinButton.get_value() max = self.maxSpinButton.get_value() - if self.min != min or self.max != max: + if min >= max: + self.minSpinButton.set_value(self.min) + self.maxSpinButton.set_value(self.max) + self.writeStatusBar("Invalid range value: must be Min < Max.") + elif self.min != min or self.max != max: self.min, self.max = min, max self.plot_image(self.min, self.max) + self.writeStatusBar("New range applied.") def on_measureButton_toggled(self, widget, data=None): self.measuring = not self.measuring -- 2.11.4.GIT