fsleyes_widgets.notebook
This module provides the Notebook class, a notebook control
similar to the wx.Notebook.
- class fsleyes_widgets.notebook.Notebook(parent, style=None, border=5)[source]
Bases:
PanelA
wx.Panelwhich provideswx.Notebook-like functionality. Manages the display of multiple child windows. A row of buttons along one side allows the user to select which child window to display.This
Notebookimplementation supports page enabling/disabling, and toggling of page visibility.Create a
Notebookobject.The side on which the notebook page buttons will be displayed can be controlled by setting one of
wx.TOP(the default),wx.BOTTOM,wx.LEFT, orwx.RIGHTon thestyleflags.The orientation of the page buttons can be set to either horizontal (the default) or vertical by setting one of
wx.HORIZONTALorwx.VERTICALon thestyleflags.- Parameters:
parent – The
wxparent object.style – Passed to
wx.Panel.__init__. If not provided, defaults towx.TOP | wx.HORIZONTAL | wx.SUNKEN_BORDER.border – Border (in pixels) around pages. Defaults to 5.
- property pages
Returns a list containing references to all of the pages in this
Notebook.
- property buttons
Returns a list containing references to all of the page buttons in this
Notebook.
- SetButtonColours(**kwargs)[source]
Set the colours used for the notebook page buttons. Set any colour to
Noneto use the default colours. All arguments must be passed as keyword arguments.- Parameters:
text – Text colour
disabledText – Text colour for disabled pages.
default – Default (unselected) background colour.
selected – Selected background colour.
- FindPage(page)[source]
Returns the index of the given page, or
wx.NOT_FOUNDif the page is not in this notebook.
- InsertPage(index, page, text)[source]
Inserts the given page into the notebook at the specified index. A button for the page is also added to the button row, with the specified text.
- AddPage(page, text)[source]
Adds the given page (and a corresponding button with the given text) to the end of the notebook.
- GetSelection()[source]
Returns the index of the currently selected page, or
Noneif there are no pages.
- fsleyes_widgets.notebook.EVT_PAGE_CHANGE = <wx.core.PyEventBinder object>
Identifier for the
PageChangeEventevent.
- fsleyes_widgets.notebook.PageChangeEvent
Event emitted when the page is changed by the user. A
PageChangeEventhas the following attributes:indexThe index of the page that was selected.