next up previous contents
Next: 2.2 Fx Widgets Up: 2 The Language Previous: 2 The Language

2.1 Prologue, menubar, and epilogue

  Every QddbScript requires a prologue, menubar, and epilogue statement. You may insert custom code before or after any of these with the code statement. A typical customized QddbScript looks like this:

    [code value={
        lappend auto_path /usr/local/lib/myapp
        MyApp:Init        ;# Load up some initial variables
    }]
    [prologue             ;# sets up Fx library and banner
        config="myapp"    ;# default configuration dir ~/.myapp_config
        bannergif="/usr/local/lib/myapp/myapp.gif"
        bannerxbm="/usr/local/lib/myapp/myapp.xbm"
        bannertitle="MyApp Version $myapp_version" ;# myapp_version set by MyApp:Init
    ]
    [menubar]  ;# sets up the default menubar
    # this is a comment
    # Frames, entries, text, and radiobuttons go here
    [epilogue] ;# finishes setup and displays the screen

Notice that the code statement sets up the Tcl auto_path variable for autoloading application-specific Tcl procedures such as MyApp:Init. The value of a code statement is inserted verbatim into the compiled QddbScript's Tcl code. See Section 3.1 for more information on inserting your own Tcl functions, menu items, and other special effects.

If the prologue statement does not contain the options listed above, they will default to the same values that the standard nxqddb(1) application uses.



Herrin Software Development, Inc.