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:
Panel
A
wx.Panel
which 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
Notebook
implementation supports page enabling/disabling, and toggling of page visibility.Create a
Notebook
object.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.RIGHT
on thestyle
flags.The orientation of the page buttons can be set to either horizontal (the default) or vertical by setting one of
wx.HORIZONTAL
orwx.VERTICAL
on thestyle
flags.- Parameters:
parent – The
wx
parent 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
None
to 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_FOUND
if 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
None
if there are no pages.
- fsleyes_widgets.notebook.EVT_PAGE_CHANGE = <wx.core.PyEventBinder object>
Identifier for the
PageChangeEvent
event.
- fsleyes_widgets.notebook.PageChangeEvent
Event emitted when the page is changed by the user. A
PageChangeEvent
has the following attributes:index
The index of the page that was selected.