Jump to content

Create a dialog box of X columns and Y rows based on delimited values in a script


---
 Share

Recommended Posts

Hello,

Is it possible to interact with the creation of a dialog from a script? For example, can you define the columns and rows of a dialog in a scripting environment before calling the dialog?

To illustrate, I’ll use a simple example.

Giving these values to these variables (left image) I want to create the dialog of the right image.

image.png.52a8dd0095d305fa44f50cbbb600e52a.pngimage.png.a72fbd45df71cfb299b58874efe11183.png

If the values given were different, the dialog would also change. See the image below.

 

image.png.8cf9d0cd966a34ea5d168a3dc86d7f04.pngimage.png.75909f0242a50832674669c3f2509f63.png

Is there any way I could control the dialog in this manner?

Thank you in advance,

Irune

Link to comment
Share on other sites

Hello Irune,

Yes, this is possible. When you insert a dialog into the script, you can select the option "Embedded into script". You will notice that the dialog definition is a Python dictionary, which is passed to gom.script.sys.create_user_defined_dialog (). Ususally, this dictionary is created with the Dialog editor and used as a constant, but it is possible to modify it before calling gom.script.sys.create_user_defined_dialog ().

For each widget in the dialog, you will see a key/value pair for "rows" and "columns" which defines its position in the dialog window. The dialog window's total number of rows and columns is calculated internally.

You can create widgets by adding entries in the dictionary by your script accordingly.

Best regards,

Matthias

Link to comment
Share on other sites

 Share

×
×
  • Create New...