# Simple SWIG Example

Below is a little evaluator for Tcl commands. Type any valid Tcl command in and see the result immediately. (you can create Tk widgets too). SWIG allows you to dynamically load C extensions into the Tcl/Tk Netscape plugin. To see how this works, type the following commands in the window below. You should be able to access any of the commands in the simple example code.

> `

>     load ./example.so example
>     fact 4
>     mod 9 3
>     get_time
>     source test.tcl

> `

### Important Security Note

In order for the "load" command to work properly, you need to install the supplied version of the file "safe.tcl" into the directory `~/.tclplug/tcl7.6` . This modification relaxes the Tcl/Tk plugin security policy by allowing you to load dynamic extensions, source Tcl scripts, and open files in the current directory (wherever you started Netscape 3.0). This is primarily provided to make it easier to play around with the plugin.