[vtkusers] Question about tcl/tk-VTK application,..
CLEMENTS, ROBERT
rclement at kent.edu
Fri Sep 11 14:23:19 EDT 2009
i assume its because $a is not a global variable and any access to it outside of your procedure is invalid (ie. with your command). You need to create a global variable i think for each $a
________________________________________
From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of Miguel Ángel Rodríguez Florido [marf at itccanarias.org]
Sent: Friday, September 11, 2009 1:01 PM
To: vtkusers at vtk.org
Subject: [vtkusers] Question about tcl/tk-VTK application,..
Hi all,
Sorry, because this question is more related to tcl/tk, but I know that
many people that works under VTK uses Tcl/Tk..so sorry again for people
that not.
My question is very simple, but I haven't found how to do that.
I have a Tcl/Tk procedure like:
proc myproc {vars} {
code
foreach a $list {
button .blabla.$a -text $a -command {puts $a}
}
}
However the foreach variable $a doesn't exist in the -command option. I
mean, I got an error when it runs this puts: puts $a.
If I do global this variable: global a, I only got the last value of $a.
So I understand that the foreach command is running first, and when it
finishs, the tcl run the -command option of the tk button.
How can I access to the variable "a" in the -command button option??. I
mean, how can I get the value of "a" at foreach step in the -command option?
Thank you very much.
Best regards.
--
Miguel Ángel Rodríguez Florido
Departamento de Ingeniería Software
División de Investigación y Desarrollo Tecnológico
INSTITUTO TECNOLOGICO DE CANARIAS, S.A. - GOBIERNO DE CANARIAS
URL: www.itccanarias.org t: +34 928 727548/457462, f: +34 928 727517
--------------------------------------------------------------------------
AVISO LEGAL:
Este mensaje y los ficheros adjuntos si los hubiere, se dirigen
exclusivamente a su destinatario y puede contener informaciÛn
privilegiada o confidencial. La transmisiÛn errÛnea del presente mensaje
en ning˙n momento supone renuncia a su confidencialidad. Si no es vd. el
destinatario indicado, queda notificado de que la utilizaciÛn,
divulgaciÛn y/o copia sin autorizaciÛn est· prohibida en virtud de la
legislaciÛn vigente. Si ha recibido este mensaje por error, le rogamos
que nos lo comunique inmediatamente por esta misma vÌa y proceda a su
destrucciÛn.
LEGAL WARNING:
This message and the files attached if there were any, are intended
exclusively for its addressee and may contain information that is
CONFIDENTIAL and protected by professional privilege. A wrong
transmission to this message don?t suppose we relinquished to It?s
confidential. If you are not the intended recipient you are hereby
notified that any dissemination, copy or disclosure of this
communication is strictly prohibited by law. If this message has been
received in error, please immediately notify us via e-mail and delete it.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list