Author Topic: No way of displaying a message box  (Read 97 times)

0 Members and 1 Guest are viewing this topic.

Offline Catalin Moldovan

  • Newbie
  • *
  • Posts: 13
No way of displaying a message box
« 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!

Offline Morten Kristensen

  • root
  • Administrator
  • Full Member
  • *****
  • Posts: 135
  • Software Engineer, Luxion
Re: No way of displaying a message box
« Reply #1 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:
Code: [Select]
lux.getInputDialog("title text", values=[(lux.DIALOG_LABEL, "message text")])

I hope that helps a bit. Thanks.
/Morten

Offline Morten Kristensen

  • root
  • Administrator
  • Full Member
  • *****
  • Posts: 135
  • Software Engineer, Luxion
Re: No way of displaying a message box
« Reply #2 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:
Code: [Select]
lux.getMessageBox(msg, [title, type])Thanks.

Offline Catalin Moldovan

  • Newbie
  • *
  • Posts: 13
Re: No way of displaying a message box
« Reply #3 on: November 22, 2019, 12:41:55 am »
Hey, thanks for the hint, that'll be great until Keyshot 9.1.
Cheers!