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)¶ Bases:
wx._core.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.
-
__init__(parent, style=None, border=5)¶ 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.
- parent – The
-
pages¶ Returns a list containing references to all of the pages in this
Notebook.
Returns a list containing references to all of the page buttons in this
Notebook.
-
SetButtonColours(**kwargs)¶ 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.
-
PageCount()¶ Returns the number of pages in this
Notebook.
-
FindPage(page)¶ Returns the index of the given page, or
wx.NOT_FOUNDif the page is not in this notebook.
-
InsertPage(index, page, text)¶ 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)¶ Adds the given page (and a corresponding button with the given text) to the end of the notebook.
-
RemovePage(index)¶ Removes the page at the specified index, but does not destroy it.
-
DeletePage(index)¶ Removes the page at the specified index, and (attempts to) destroy it.
-
GetSelection()¶ Returns the index of the currently selected page, or
Noneif there are no pages.
-
SetSelection(index)¶ Sets the displayed page to the one at the specified index.
-
AdvanceSelection(forward=True)¶ Selects the next (or previous, if
forwardisFalse) enabled page.
-
EnablePage(index)¶ Enables the page at the specified index.
-
DisablePage(index)¶ Disables the page at the specified index.
-
ShowPage(index)¶ Shows the page at the specified index.
-
HidePage(index)¶ Hides the page at the specified index.
-
_Notebook__onButton(ev)¶ Called when a page button is pushed. Selects the respective page, and emits a
PageChangeEvent.
-
_Notebook__updateMinSize()¶ Calculate and return the best (minimum) size for this
Notebookinstance.The returned size is the minimum size of the largest page, plus the size of the button panel.
-
__module__= 'fsleyes_widgets.notebook'¶
- parent – The
-
fsleyes_widgets.notebook.EVT_PAGE_CHANGE= <wx.core.PyEventBinder object>¶ Identifier for the
PageChangeEventevent.
-
fsleyes_widgets.notebook.PageChangeEvent¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event