GiD - The personal pre and post processor

Confuse label with value


You must separate the concepts of the label, for example of a button, from the command to be sent. Sometimes the same tag is used as the return value, which becomes an error when translating.

For example, an "ok" button that returns its label as command = "ok"


When translating in Spanish, it will appear "aceptar", but instead as a command it should keep sending "ok", not "aceptar".

Therefore, the value of the command must be separated from the label shown in all the procedures in which it is confused.


This case is unavoidable if, for example, a widget of type tk_optionMenu is used, which is why its use is discouraged (it should be removed from files such as those related to copy-move: CopyMain.ui.tcl, CopyTrans.ui.tcl, ...). Currently both the menu text and the keywords are translated with which the CopyMoveInfo (*) variable associated with the menu value will be after compared. 

Another example:

set types { Lines Points Surfaces Volumes }
foreach type $types {
  label $w.$type -text $type -command "Show $type"
}

In this case the type is used as text and as a parameter to a function, and become a problem.
It is recommended to create two lists and treat them separately, like this.

set types { Lines Points Surfaces Volumes }
set types_label { [_ "Lines"] [_ "Points"] [_ "Surfaces"] [_ "Volumes"] }
foreach type $types label $types_label {
   label $w.$type -text $label -command "Show $type"
}

COPYRIGHT © 2022 · GID · CIMNE