Class widget:notebook
Notebook widget
The notebook widget allows switching between a set of widgets, only one of which will be visible at a given time.
Methods
notebook:count ()
Get the number of pages in the notebook.
Return Values
-
integerThe number of pages in the notebook.
notebook:current ()
Get the page number of the currently visible page.
Return Values
-
integerThe 1-based index of the currently visible page.
notebook:get_title (child)
Get the tab label text for a particular child widget.
Parameters
-
childType: widgetThe child widget.
notebook:set_title (child, title)
Set the tab label text for a particular child widget.
Parameters
-
childType: widgetThe child widget.
-
titleType: stringThe new tab label text.
notebook:indexof (child)
Get the page number of the given child widget.
Parameters
-
childType: widgetThe child widget.
Return Values
-
integerThe 1-based index of the child widget.
notebook:insert (index, child)
Add a new child widget to the notebook, adding a new page.
Parameters
-
indexType: integerOptionalPosition to add the widget. Defaults to adding at the end.
-
childType: widgetThe new child widget to add.
notebook:switch (index)
Switch to a notebook page.
Parameters
-
indexType: integerThe 1-based index of the page to switch to.
notebook:reorder (child, index)
Move a given child widget to a different position.
Parameters
-
childType: widgetThe child widget.
-
indexType: integerThe 1-based index of the new page number, or -1 to move it to the last position.
Properties
notebook.show_tabs
true
notebook.show_border
false
Signals
"key-press"
Emitted when a key is pressed while the notebook widget has the input focus.
Parameters
-
modifiersType: tableAn array of strings, one for each modifier key held.
-
keyType: stringThe key that was pressed, if printable, or a keysym otherwise.
Return Values
-
boolean
true
if the event has been handled and should not be propagated further.
"page-added"
Emitted immediately after a new widget is added to the notebook, adding a new page.
Parameters
-
childType: widgetThe new child widget.
-
indexType: integerThe 1-based page index of the new child widget.
"page-removed"
Emitted immediately after a widget is removed from the notebook, removing a page.
Parameters
-
childType: widgetThe child widget that was removed.
"page-reordered"
Emitted immediately after a notebook page has been reordered.
Parameters
-
childType: widgetThe child widget that was reordered.
-
indexType: integerThe new 1-based page index of the child widget.
"switch-page"
Emitted when the currently visible page of the notebook is changed.
Parameters
-
childType: widgetThe child widget that is being switched to.
-
indexType: integerThe 1-based index of the page that is being switched to.
Attribution
Copyright
- 2010 Mason Larobina