Skip to content

Commit

Permalink
The main window is not the parent of SpectrumProjectionWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc committed Oct 31, 2024
1 parent 48af91c commit cda8ff9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mantidimaging/gui/windows/spectrum_viewer/spectrum_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,12 @@ def set_tof_axis_label(self, tof_axis_label: str) -> None:
class SpectrumProjectionWidget(GraphicsLayoutWidget):
image: MIMiniImageView

def __init__(self, parent: MainWindowView) -> None:
super().__init__(parent)
self._main_window = parent
def __init__(self, main_window: MainWindowView) -> None:
super().__init__()
self.image = MIMiniImageView(name="Projection", view_box_type=CustomViewBox)
self.addItem(self.image, 0, 0)
self.ci.layout.setRowStretchFactor(0, 3)

nan_check_menu = [("Crop Coordinates", lambda: self._main_window.presenter.show_operation("Crop Coordinates")),
("NaN Removal", lambda: self._main_window.presenter.show_operation("NaN Removal"))]
nan_check_menu = [("Crop Coordinates", lambda: main_window.presenter.show_operation("Crop Coordinates")),
("NaN Removal", lambda: main_window.presenter.show_operation("NaN Removal"))]
self.image.enable_nan_check(actions=nan_check_menu)

0 comments on commit cda8ff9

Please sign in to comment.