One way around this, if I recall right, is to manually add the OK/cancel button, with OK first.. The first button gets clicked when you press return, so it works fine

..that is, until until you want to add another button to the dialog (e.g a "reset" button next to a parameter), in which case that gets pressed instead

Seems like a nuke.DIALOG_ACCEPT/nuke.DIALOG_CANCEL flag for buttons would be useful - maybe even a nuke.DEFAULTFOCUS to say what knob is selected by default?

Bernhard Kimbacher wrote:
the only workaround i found is to add my own ok-button (but no cancel button) like this:

        self.okButton = nuke.Script_Knob( "OK" )
        self.addKnob( self.okButton )

with this you only have one button it can default to, and you can use the X as cancel...

-Bernie

------------------------------------------------------------------------ *From:* [email protected] [[email protected]] on behalf of Hugh [[email protected]]
*Sent:* Tuesday, May 24, 2011 2:04 PM
*To:* [email protected]
*Subject:* [Nuke-python] Re: pythonPanel default button?

This one has been catching me out a few times recently, on our render submission panel...

I'd love to hear any solutions - I'm considering writing a new panel class that will let me do more with the buttons, including defining (if the slightly lower level will let me) the defaults for ENTER and ESC.


------------------------------------------------------------------------

_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

--
ben dickson
2D TD | [email protected]
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to