On Mon, 13 Aug 2001, John Coppens wrote:
> Hi all.
>
> I'm just starting to get a hang of some of the beautifull things of vTcl. Here's
> a problem though:
>
> I've made a small editor which loads macros from a default file and adds them
> to one of the menu items in the menu bar. Not knowing better, I put this code
> in the 'init' proc. It works just fine.
>
> Except, that when I load the code into vTcl, this code also executes, and as such
> modifies the menu item. vTcl then wants to save this as a program modification to
> disk.
>
> Any idea how to avoid this?
You can detect when you're in the vTcl environment:
proc init {argc argv} {
# Init stuff goes here...
if {[info exists ::vTcl]} {
# The code following this point isn't meant to be runable within vTcl
return
}
# Your macros go here...
}
...RickM...
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/vtcl-user