fsleyes.actions.togglecontrolpanel
¶
This module provides the ToggleControlPanelAction
class,
an action intended for use by ViewPanel
classes to manage
the addition/removal of control panels.
-
class
fsleyes.actions.togglecontrolpanel.
ToggleControlPanelAction
(overlayList, displayCtx, func, instance, cpType)[source]¶ Bases:
fsleyes.actions.base.ToggleAction
The
ToggleControlPanelAction
class is an action which is intended to augmentViewPanel
actions which add/remove a control panel.The
ToggleControlPanelAction
keeps track of theViewPanel
state, and updates its ownToggleAction.toggled
property whenever its designated control panel is added/removed from theViewPanel
.This sounds a bit silly, but is necessary to ensure that any bound widgets (most likely menu items) are updated whenever the control panel managed by a
ToggleControlPanelAction
is added/removed.-
__init__
(overlayList, displayCtx, func, instance, cpType)[source]¶ Create a
ToggleControlPanelAction
.Parameters: - overlayList – The
OverlayList
- displayCtx – The
DisplayContext
- func – The function which toggles the
- instance – The
ViewPanel
instance. - cpType – The type of the control panel being managed by this
ToggleControlPanelAction
.
- overlayList – The
-
destroy
()[source]¶ Must be called when this
ToggleControlPanelAction
is no longer used. Clears references, and calls the base-classdestroy
method.
-
_ToggleControlPanelAction__viewPanelChanged
(ev)¶ Called whenever a control panel is added to/removed from the
ViewPanel
that owns thisToggleControlPanelAction
. Updates theToggleAction.toggled
attribute of this action.
-
__module__
= 'fsleyes.actions.togglecontrolpanel'¶
-