registerWidgetAsPanel(widget,
name,
id,
create=False)
| source code
|
Wraps and registers a widget to be used in a Nuke panel.
widget - should be a string of the class for the widget
name - is is the name as it will appear on the Pane menu
id - should the the unique ID for this widget panel
create - if this is set to true a new NukePanel will be returned that wraps this widget
Example ( using PyQt )
import nuke
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
from nukescripts import panels
class NukeTestWindow(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setLayout( QtGui.QVBoxLayout() )
self.myTable = QtGui.QTableWidget( )
self.myTable.header = ['Date', 'Files', 'Size', 'Path' ]
self.myTable.size = [ 75, 375, 85, 600 ]
self.layout().addWidget( self.myTable )
nukescripts.registerWidgetAsPanel('NukeTestWindow', 'NukeTestWindow', 'uk.co.thefoundry.NukeTestWindow' )
- Returns: PythonPanel
|