And clicking the send button seems to have wacked my brain into gear.
If I make "p" a global variable it works.
Ignore me
On 21/12/15 8:04 pm, Frank Rueter|OHUfx wrote:
Hi everyone,
feeling a bit stupid but I'm struggling to open a simple PySide widget
from Nuke's menu bar and it feels like I have run into this before. It
works fine in the script editor but not from the menu (I see it flash
up for a split second at best). What am I missing?
from PySide import QtGui
import nukescripts
class TestWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(TestWidget, self).__init__(parent)
self.setLayout(QtGui.QVBoxLayout())
btn = QtGui.QPushButton('test')
self.layout().addWidget(btn)
def showPanel():
p = TestWidget()
p.show()
helpMenu = nuke.menu('Nuke').findItem('Help')
helpMenu.addCommand('test', showPanel)
Cheers,
frank
--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation
and consulting <http://ohufx.com/index.php/vfx-customising>* *
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation
and consulting <http://ohufx.com/index.php/vfx-customising>* *
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python