A PyTabWidget is one of the GUI pane onto which the user can dock tabs such as the NodeGraph, CurveEditor… See detailed description…


Detailed Description

The PyTabWidget class is used to represent panes visible in the user interface:


On the screenshot above, each PyTabWidget is surrounded by a red box.

You cannot construct tab widgets on your own, you must call one of the splitVertically() or splitHorizontally() functions to make a new one based on another existing ones.

By default the GUI of Natron cannot have less than 1 tab widget active, hence you can always split it to make new panes.

To retrieve an existing PyTabWidget you can call the getTabWidget(scriptName) function of GuiApp.

pane1 = app.getTabWidget(“Pane1”)

Note that the script-name of a pane can be seen on the graphical user interface by hovering the mouse over the “Manage layout” button (in the top left hand corner of a pane).


Managing tabs

To insert tabs in the TabWidget you can call either appendTab(tab) or insertTab(index,tab).


Note that to insert a tab, it must be first removed from the tab into which it was.

To remove a tab, use the function removeTab(tab) on the parent PyTabWidget

For convenience to move tabs around, there is a moveTab(tab,pane) function in GuiApp.

The function closeTab(index) can be used to close permanently a tab, effectively destroying it.

To change the current tab, you can use one of the following functions:

  • setCurrentIndex(index)<NatronGui.PyTabWidget.setCurrentIndex>
  • setNextTabCurrent()<NatronGui.PyTabWidget.setNextTabCurrent>

To float the current tab into a new floating window, use the floatCurrentTab()<NatronGui.PyTabWidget.floatCurrentTab> function.

Managing the pane

To close the pane permanently, use the closePane()<NatronGui.PyTabWidget.closePane> function. To float the pane into a new floating window with all its tabs, use the floatPane() function.

Member functions description

Parameters:tabQWidget <>

Appends a new tab to the tab widget and makes it current.


Closes the current tab, effectively destroying it.


Closes the tab at the given index, effectively destroying it.


Closes this pane, effectively destroying it. Note that all tabs will not be destroyed but instead moved to another existing pane.


If this pane is the last one on the GUI, this function does nothing.

Return type:int

Returns the number of tabs in this pane.

Return type:QWidget <>

Returns the current active tab.


Make a new floating window with a single pane and moves the current tab of this pane to the new pane of the floating window.


Make a new floating window and moves this pane to the new window (including all tabs).

Return type:int

Returns the index of the current tab. This is 0-based (starting from the left).

Return type:str

Returns the script-name of the pane, as used by the getTabWidget(scriptName) function.

Return type:str

Returns the name of the tab at the given index if it exists or an empty string otherwise.

NatronGui.PyTabWidget.insertTab(index, tab)
  • tabQWidget <>
  • indexint

Inserts the given tab at the given index in this tab-widget.

Parameters:tabQWidget <>

Removes the given tab from this pane if it is found. Note that this function does not destroy the tab, unlike closeTab(index).

This is used internally by moveTab(tab,pane).


Same as removeTab(tab) but the index of a tab is given instead.


Makes the tab at the given index (0-based) the current one (if the index is valid).


Set the tab at getCurrentIndex() + 1 the current one. This functions cycles back to the first tab once the last tab is reached.

Return type:PyTabWidget

Splits this pane into 2 horizontally-separated panes. The new pane will be returned.

Return type:PyTabWidget

Splits this pane into 2 vertically-separated panes. The new pane will be returned.