fsleyes_widgets.togglepanel
This module provides the TogglePanel class, which is a panel that
contains a button and some content. Pushing the button toggles the visibility
of the content.
- class fsleyes_widgets.togglepanel.TogglePanel(parent, toggleSide=64, initialState=True, label=None)[source]
Bases:
PanelA
TogglePanelis awx.Panelthat contains a button and some content.Pushing the button toggles the visibility of the content.
All of the content should be added to the panel which is returned by the
GetPane()method.The
TogglePanelmay be used in place of thewx.CollapsiblePane, which is buggy under Linux/GTK.Create a
TogglePanel.- Parameters:
parent – The
wxparent object.toggleSide – Which side to place the toggle button. Must be one of
wx.TOP,wx.BOTTOM,wx.LEFT, orwx.RIGHT.initialState – Initial state for the panel content - visible (
True) or hidden (False).label – A label to be displayed on the toggle button.
- property button
Returns the toggle button (actually a
wx.StaticText). This is for testing purposes.
- GetToggleButton()[source]
Returns the toggle button (actually a
wx.StaticText). This is for testing purposes.
- Expand(expand=True)[source]
Expand the content pane.
- Parameters:
expand –
Trueto expand,Falseto collapse.
- fsleyes_widgets.togglepanel.EVT_TOGGLEPANEL_EVENT = <wx.core.PyEventBinder object>
Identifier for the
TogglePanelEventevent.
- fsleyes_widgets.togglepanel.TogglePanelEvent
Event emitted when the toggle button is pushed. Contains the following attributes:
newState: The new visibility state of the toggle panel -Truecorresponds to visible,
Falseto invisible.