next up previous contents
Next: 3.2 Accessing Fx Widgets Up: 3 Custom Programming Previous: 3 Custom Programming

3.1 The code statement

  In its simplest form, a QddbScript is self-contained and requires no external code. However, if you want to add custom features to your interface or access the full capabilities of Fx, you must insert some links to Tcl code inside the QddbScript.

As we saw in Section 2.1, you can add your own library to the Tcl auto_path variable as follows:

    [code value={
        lappend auto_path /usr/local/lib/myapp
    }]
    [prologue]
    # ...

After appending your application's library directory to the auto_path, you can freely call Tcl procedures indexed in that directory:

    [code value={
        MyAppFunction1 arg1 arg2
        MyAppFunction2
    }]

The code values are inserted verbatim into the compiled Fx script at the global level and are clearly surrounded by comments:

    ;# [USER-INSERTED CODE]

        MyAppFunction1 arg1 arg2
        MyAppFunction2

    ;# [END USER-INSERTED CODE]



Herrin Software Development, Inc.