fsleyes.actions.removeoverlay

This module provides the RemoveOverlayAction class, and the removeOverlay() function, which provides logic to remove an overlay from the OverlayList.

class fsleyes.actions.removeoverlay.RemoveOverlayAction(overlayList, displayCtx, frame)[source]

Bases: fsleyes.actions.base.Action

The RemoveOverlayAction allows the uesr to remove the currently selected overlay.

__init__(overlayList, displayCtx, frame)[source]

Create a RemoveOverlayAction.

Parameters
destroy()[source]

Must be called when this RemoveOverlayAction is no longer needed. Removes property listeners, and then calls Action.destroy().

__overlayListChanged(*a)

Called when the OverlayList changes. Updates the Action.enabled flag

__removeOverlay()

Removes the currently selected overlay (as defined by the DisplayContext.selectedOverlay) from the :class:.OverlayList`.

__annotations__ = {}
__module__ = 'fsleyes.actions.removeoverlay'
fsleyes.actions.removeoverlay.removeOverlay(overlayList, displayCtx, overlay=None, stringKey=None)[source]

Removes the specified overlay (or the currently selected overlay, if overlay is None) from the overlay list. If the overlay is not saved, the user is prompted to confirm the removal.

Parameters
  • overlay – Overlay to remove. If None, the currently selected overlay is removed.

  • stringKey – Key to use in the strings module for the dialog with which the user is prompted if the overlay has unsaved changes.

Returns

True if the overlay was removed, False otherise.