1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
############################################
# TKSCILAB Gui Interface facility for Scilab
# Bertrand Guiheneuf - 1998
############################################
#
# $Id: callbacks.tcl,v 1.4 1998/02/15 17:49:59 guiheneu Exp guiheneu $
######################################################################################
proc SciCallback { name callback } {
# called in all control callbacks
global "$name";
set handle [set "$name\(handle)"];
global gcbo;
set old_gcbo $gcbo;
set gcbo $handle;
# call the scilab routine (in C) allowing to execute a 'scilab' string
# it passes the whole string to the scilab parser
set com "gcbo=$gcbo; $callback; gcbo=$old_gcbo;"
ScilabEval $com;
set gcbo $old_gcbo;
}
proc SliderSciCallback { name callback slidervalue} {
# called in slider control callbacks
global "$name";
set handle [set "$name\(handle)"];
global gcbo;
set gcbo $handle;
# call the scilab routine (in C) allowing to execute a 'scilab' string
# it passes the whole string to the scilab parser
ScilabEval $callback;
}
######################################################################################
proc popupsel { name itemnb } {
# answer to a popup item selevtion
global "$name";
set path [set "$name\(path)"];
set string [set "$name\(string)"];
set "$name\(value)" $itemnb
set item [split $string "|"];
set label [lindex $item $itemnb];
$path configure -text $label;
# call the popupmenu callback command
if [ info exists "$name\(callback)"] {
SciCallback $name $callback
}
}
|