1 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
3 # $Id: EMaxima.tcl,v 1.4 2011-03-19 23:16:41 villate Exp $
5 ###### EMaxima.tcl ######
6 ############################################################
7 # Netmath Copyright (C) 1998 William F. Schelter #
8 # For distribution under GNU public License. See COPYING. #
9 ############################################################
13 #-----------------------------------------------------------------
15 # insertResult_maxima -- insert result RES, in text window W,
16 # into RESULTRANGE. The command which was sent to maxima came
17 # from THISRANGE. For plots if a resultRANGE is missing,
18 # we use a space just after the end of the line of THISRANGE.
19 # checks if this is plotdata, and if so makes plot win for it.
23 # Side Effects: inserts in text or graph in window W.
25 #----------------------------------------------------------------
28 proc insertResult_maxima
{ w thisRange resultRange res
} {
31 # puts <lengthres=[llength $res],thisRange=$thisRange,resultRange=$resultRange>
33 if { 0 == [string compare
"$res" "cant connect"] } {
34 bgerror [concat [mc
"unable to call"] "$program"]
36 if { [regexp "\{plot\[23\]d" $res] ||
[regexp "\{plotdf" $res] \
37 ||
[regexp "\{scene" $res] } {
39 set name
[plotWindowName
$w [lindex $res 0]]
40 eval plot2dData
$name $res [getDimensions
$w $name]
41 set desired
[setDesiredDims
$w $name $thisRange ]
42 ShowPlotWindow
$w $name $thisRange $resultRange $desired
46 if { "$resultRange" != "" } {
47 set name
$w.plot
[oset
$w counter
[expr {1 + [oget
$w counter
]}]]
48 insertResult
$w $resultRange $res
54 ## endsource emaxima.tcl