Plug-in code and execution |
Each
plug-in definition has a list of alternating parameter names and Tcl
expressions. Parameter names must be valid Tcl variable names and
start with "_" (underscore). The expressions are evaluated in the
context of the procedure that creates each plug-in widget (there may
be more than one), and the resulting values togeteher with the
parameter names are passed as optional arguments to the procedure
PlugInExec
used as call-back.
This procedure starts by setting up the plug-in parameters by
assigning to each parameter name the corresponding value. If a name
does not start with "_" (underscore) the procedure returns after
issuing an error message. Otherwise the plug-in code is executed by
using Tcl eval
.
This way of dealing with parameters makes it possible for the plug-in code to access variables in the procedures that create the widgets thus avoiding the need to recompute information that is available there. The plug-in code may, of course, access global variables by declaring them as such. It should refrain to set global variables and in order to avoid clashes with GPSMan procedures and local variables of the call-back procedure it should use names starting by "_" (underscore) if procedures or local variables are defined.
GPSMan User Manual and the GPSMan logo images by Miguel Filgueiras are licensed under a Creative
Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Plug-in code and execution |