Jump to content
Drughi

Confirm ui message

Recommended Posts

Is there a way to confirm a display message with python?

Share this post


Link to post
Share on other sites
Posted (edited)

Sorry for being blind. I cant find it.
I want to "click away" / accept a display message. What function do you mean?

Edited by Drughi

Share this post


Link to post
Share on other sites

Please refer to displayConfirmation/displayMessage. 

'''Prompt the user if they want to overwrite a file, and save it if they choose OK.'''
    if hou.ui.displayConfirmation("Overwrite the current hip file?", suppress=hou.confirmType.OverwriteFile):
        hou.hipFile.save()

'''Prompt the user if they want to save, and save the hip file if they choose Yes.'''
    if hou.ui.displayMessage("Save the current hip file?", buttons=("Yes", "No")) == 0:
        hou.hipFile.save()

-J

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×