3c. Practical scripting guide: How to create a graphical component

In this example a dialog is created and shown on the screen.
The basis of a graphical component is always a 'Dialog'. First the dialog is created ('bvDialog = new Dialog;') , after that the dialog properties are added ('bvDialog.caption = "BrainVoyager document info";'). All other graphical features are added to this basis component.

The other graphical components like line edits, buttons, checkboxes and text labels should be created in the same way:
First initiate it ('var lblFMRName = new Label'), add properties ('lblFMRName.text = 'Name of active document: " + BVdoc.name;) and then add it to the main dialog ('bvDialog.add( lblFMRName )').
Also HTML features can be added to text labels (see figure).

The dialog is finally shown by stating 'bvDialog.exec()'.

And this is the result:

 

Next: 3d. How to create interactive components
Index