Getting Started With Tcl interface of Dalė


Interactive Shell

First launch you Tcl shell. Depending on your system, you shell might be called differently (tclsh80, or simply tclsh).

To see if Dali is installed correctly, execute this command :

    package require DvmBasic
    
If it is executed correctly, the command should return the value 1.0. If it says
    can't find package DvmBasic
    
Then Dalė packages are not installed correctly. See the installation guide for how to instal Dalė

You can execute an example by sourcing the file. For example if you like to run the foo.tcl example without argument, run :

    source foo.tcl
    
in the directory where foo.tcl is located.

Most scripts support input arguments. You can change the number of inputs arguments and the arguemnts itself by setting the variables argc and argv respectively. For example, if you want to run foo.tcl with 2 arguments "bar.jpg 40",

    set argc 2
    set argv {bar.jpg 40}
    source foo.tcl
    

Interactive Shell with Display Capability

First launch you tk shell. Depending on your system, you shell might be called differently (wish80, or simply wish).

To see if Dali is installed correctly, follow the steps described in previous section. To see if the Display package is installed correctly, execute this command :

    package require DvmDisplay
    
If it is executed correctly, the command should return the value 1.0. If it says
    can't find package DvmDisplay
    
Then the Display package is not installed correctly. See the installation guide.

After DvmDisplay is loaded, you need to source the file display.tcl to start using the display capability. Assuming the file display.tcl is in your current directory, you source the file by :

    source display.tcl
    
Now you can use rgb_display and byte_display to display a RGB image (three ByteImages) and a gray scale image (a ByteImage) respectively.

Noninteractive Execution

You can also execute the Dalė scripts directly using
    tclsh <script name> <arguments>
    
at the command prompt. For example,
    tclsh foo.tcl bar.jpg 40
    
will run foo.tcl with the specified arguments.

Running Dali with dvmsh

dvmsh is an extension to Tcl Shell with all Dali packages preloaded. Using dvmsh is no different from using Tcl shell, except that you do not need to perform package loading using package require command.

Last Updated : 08/06/2025 02:43:31