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:
Panel
A
TogglePanel
is awx.Panel
that 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
TogglePanel
may be used in place of thewx.CollapsiblePane
, which is buggy under Linux/GTK.Create a
TogglePanel
.- Parameters:
parent – The
wx
parent 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 –
True
to expand,False
to collapse.
- fsleyes_widgets.togglepanel.EVT_TOGGLEPANEL_EVENT = <wx.core.PyEventBinder object>
Identifier for the
TogglePanelEvent
event.
- 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 -True
corresponds to visible,
False
to invisible.