> I am currently designing a GUI with vtcl, a very easy to use and intuitive
> tool indeed!
>
> Now I would like to add a navigator or a file selector to allow
> the user to select a file from a file hierarchy. This widget does
> not exist in the vtcl widgets palette.
>
> What should I do to make the instanciation of a file selector possible?
> There is probably something to declare like "package require xxx"
> but where should I declare this? And what to do afterwards? How do
> I instantiate the new widget within vtcl?
If you want generic file selection, use tk_getOpenFile or tk_getSaveFile
For example:
If you have a button '.b1' that the user needs to push to invoke a file
selection dialog, a simple example would be like so:
button .b1 -text Open -command {
set foofile [tk_getOpenFile -parent . -title "Open file"]
puts "File chosen is $foofile"
}
pack .b1
-------------------------------
This creates a button labeled 'Open'. When invoked, the user is presented with
a file selection dialogue. When the user selects the desired file and pu
shes OK, foofile is assigned the path to the file.
In vtcl, open the 'command' dialog for the desired widget, and put this code
into it. Voila.
tk_getOpenFile and tk_getSaveFile have several options not mentioned here. For
further explanation and arguments to these commands:
man tk_getOpenFile
man tk_getSaveFile
Hope this helps,
Mike Avery
---------------------------------------------------------------------------
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).