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.ActionThe
RemoveOverlayActionallows the uesr to remove the currently selected overlay.-
__init__(overlayList, displayCtx, frame)[source]¶ Create a
RemoveOverlayAction.- Parameters
overlayList – The
OverlayList.displayCtx – The
DisplayContext.frame – The
FSLeyesFrame.
-
destroy()[source]¶ Must be called when this
RemoveOverlayActionis no longer needed. Removes property listeners, and then callsAction.destroy().
-
_RemoveOverlayAction__overlayListChanged(*a)¶ Called when the
OverlayListchanges. Updates theAction.enabledflag
-
_RemoveOverlayAction__removeOverlay()¶ Removes the currently selected overlay (as defined by the
DisplayContext.selectedOverlay) from the :class:.OverlayList`.
-
__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
stringsmodule for the dialog with which the user is prompted if the overlay has unsaved changes.
- Returns
Trueif the overlay was removed,Falseotherise.