Rick Macdonald wrote:
> 
> On Wed, 2 Jun 1999, Helmut Schrvder wrote:
> 
> > I made a GUI with vtcl and declared some procedures in external library
> > files e.g. lib.tcl to do some other work. The library file is imported
> > with the auto_path command. This is no problem.
> > But when I load the GUI in vtcl , change something in the GUI and save
> > the work, then all the externel procedures are stored in the vtcl file.
> > Does any body know how to avoid this?
> 
> Somebody please add this to the FAQ if it isn't already. Is the FAQ on
> Stewart's web page?

Yes, it is in the FAQ. I agree that the Question itself needs a FAQ :(

Q-11: I am wanting to know how to have a place to put functions that I
might want to include in several apps. but I do not know what to do in
tcl
and then how to do it as well in vtcl?

A-11: Rick Macdonald <[EMAIL PROTECTED]> has a solution: you should create a
Tcl library with your functions (see a Tcl FAQ), then run the
"auto_mkindex"
command and then add your library directory to the auto_path:

        lappend auto_path /usr/local/lib/MyTcl

where /usr/local/lib/MyTcl is the directory where your Tcl library is.

The problem is that when you load the application into vTcl, it will
save  
these functions into the application, and you don't want that. To avoid
it,
just add

    append vTcl(proc,ignore) "|mylib_*"

This assumes that all the procs that you source in start with the string
"mylib_". I'm not sure where to put this. Perhaps in your "init"
function.
It may be that vTcl runs the init function every time you switch to
TEST  
mode, in which case the vTcl(proc,ignore) value would get longer and
longer. But maybe this won't happen [ can somebody check this?] . Or,
you
could put it into the vTcl "globals.tcl" file. The vTcl default is to
ignore procedures matching "tcl.*|tk.*|auto_.*|bgerror|\\..*":

        set vTcl(proc,ignore)    "tcl.*|tk.*|auto_.*|bgerror|\\..*"

The simplest solution will be to always call your functions starting
with the
string "tcl". Then you don't even have to modify the vTcl ignore list.


-- 
Joao Cardoso                |   e-mail: [EMAIL PROTECTED]
INESC, R. Jose Falcao 110   |   tel:    + 351 2 2094322
4050 Porto, Portugal        |   fax:    + 351 2 2008487
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to