On Tue, 05 Dec 2000, Pieter De Troyer wrote:
> Hi all,
>
> I'm very new with vtcl and i have some basic questions.
>
> Using vtcl 1.2.1 I succeeded in making a nice looking GUI that actually
> does nothing yet. After browsing different tutorials I couldn't find out
> how i can create procedures and variables for my program without vtcl
> overwriting them when saving the gui? At this moment I made the GUI,
> saved it and then added some procedures and variables at the ensd of the
> file. Reopening it in vtcl and making some adjustments everything got
> lost when i saved the changes. is there a way to make procs etc. in vtcl
> itself?
Your mistake was to put them at the end of your file.
If you look at the code vtcl generates when you write procs you will see that they are
put just
after the init call.
You can place them for instance there.
A more elegant way would be to put them in a separate file and source this from the
init proc.
But make sure you read it only if vtcl isn't running.
Otherwise the procedures will be dumped into the gui-file when you save it.
You can determine this by the existence of the global variable vTcl:
proc init {argc argv} {
global vTcl
if {![info exists vTcl]} {
source "myprocs.tcl"
}
}
You can also put your file into a separate directory and add this directory to the
auto_path
variable. You must then run tixindex within this directory which will create a file
called tclIndex.
The file containing the called procedure will then automagically be sourced if needed.
Don't forget to run tixindex each time after adding procedures so they can be found!
>
> Other question: i want to use to almost identical frames in the window.
> I would use some variables to make them look alike. How can this be done
> in vtcl?
>
> Thanks a lot!
>
>
> Pieter
Kind regards
Carsten
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/vtcl-user