KeyShot Forum

Technical discussions => Extending KeyShot => Scripting => Topic started by: Catalin Moldovan on November 21, 2019, 01:30:15 AM

Title: No way of displaying a message box
Post by: Catalin Moldovan on November 21, 2019, 01:30:15 AM
Looking at the scripting API, I don't seem to find any proper way of displaying a modal message box to the user. There are various cases when this is needed, like informing the user about an error and the lux.getInputText() is the only way to display a text dialog, but that's editable and not suited for these cases.
Is it possible to add a flag to the lux.getInputText() function to act as read-only message dialog with only a confirmation button or add a proper API for a message box?
Thank you!
Title: Re: No way of displaying a message box
Post by: Morten Kristensen on November 21, 2019, 11:15:10 PM
Hi heretique,

It is a very good point about adding a regular message box with title, message, and a type (info, warning, critical..) for a future release.

In the meantime, you can use the following trick to get a non-editable message box:
lux.getInputDialog("title text", values=[(lux.DIALOG_LABEL, "message text")])


I hope that helps a bit. Thanks.
/Morten
Title: Re: No way of displaying a message box
Post by: Morten Kristensen on November 22, 2019, 12:20:30 AM
Hi again. Just wanted to inform you that it's been implemented and will be in KeyShot 9.1: lux.getMessageBox(msg, [title, type])
Thanks.
Title: Re: No way of displaying a message box
Post by: Catalin Moldovan on November 22, 2019, 12:41:55 AM
Hey, thanks for the hint, that'll be great until Keyshot 9.1.
Cheers!