2.1.3. Examples

This section provides examples of dialog boxes being created in Fluent.

2.1.3.1. Example One

This is an example of a very simple dialog box containing only an empty table. The apply-cb and update-cb arguments must be included in the cx-create-panel statement, but in this case they have been simplified to just Boolean values rather than functions. Note that the apply-cb variable must be #t if you use a Boolean value instead of a function, because using #f will remove the OK button from the dialog box. Due to the lack of any data input fields on the dialog box and the use of Boolean values in the place of function calls, this dialog box does not serve any purpose, and is intended to simply illustrate the process of creating a dialog box.

(define apply-cb #t)
(define update-cb #f)
(define my-dialog-box (cx-create-panel "My Dialog Box" apply-cb update-cb))
(define table)
(set! table(cx-create-table my-dialog-box "This is an example Dialog Box"))
(cx-show-panel my-dialog-box)

2.1.3.2. Example Two

This is an example of a dialog box with a few basic data input fields added. The apply-cb and update-cb arguments must be included in the cx-create-panel statement, but in this case they have been simplified to just Boolean values rather than functions. Note that the apply-cb variable must be #t if you use a Boolean value instead of a function, because using #f will remove the OK button from the dialog box. Due to the use of boolean values in the place of function calls, this dialog box does not serve any purpose, and is intended to simply illustrate the process of creating a dialog box with various data input fields.

(define apply-cb #t)
(define update-cb #f)

(define table)
(define checkbox)
(define ints)
(define reals)
(define txt)

(define my-dialog-box (cx-create-panel "My Dialog Box" apply-cb update-cb))

(set! table (cx-create-table my-dialog-box "This is an example Dialog Box"))

(set! checkbox (cx-create-toggle-button table "Check Box" 'row 0))
(set! ints (cx-create-integer-entry table "For Ints" 'row 1))
(set! reals (cx-create-real-entry table "For Reals" 'row 2))
(set! txt (cx-create-text-entry table "For Text" 'row 3))

(cx-show-panel my-dialog-box)

2.1.3.3. Additional Examples

For further examples of dialog boxes with additional elements, see Comprehensive Examples.


Release 18.2 - © ANSYS, Inc. All rights reserved.