This example shows how the cx-create-integer-entry, cx-set-integer-entry and cx-show-integer-entry macros work. Once the integer entry field has been created, the
initial value of the field is set to 1 via
the statement (cx-set-integer-entry intField 1). Next, the value of that integer entry field is incremented to 2 using another cx-set-integer-entry statement. This statement also has a cx-show-integer-entry statement nested in it in order to get the value already in the
integer entry field and increment it by 1.
By the time the cx-show-panel statement
is read, the value of intField is now 2, so the number 2 appears
in the integer entry field when the dialog box is opened. This dialog
box does not do anything when the button
is clicked because we have substituted Boolean values for the apply-cb and update-cb arguments,
which would normally be function calls. For more information on the apply-cb and update-cb functions,
see cx-create-panel.

(define apply-cb #t) (define update-cb #f) (define table) (define intField) (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! intField (cx-create-integer-entry table "Integer Entry Field")) (cx-set-integer-entry intField 1) (cx-set-integer-entry intField (+ 1 (cx-show-integer-entry intField))) (cx-show-panel my-dialog-box)
To view additional examples of integer entry fields, see Comprehensive Examples.