2 # Time-stamp: "2024-04-01 14:13:55 villate"
4 # Attach this at the bottom of the xmaxima code to start up the interface.
11 if { [llength $maxima_priv(plotfile
)] > 0 } {
12 set fptr
[open [lindex $maxima_priv(plotfile
) 0] r
]
13 regsub -all -- {/\*.
*?
\*/} [read $fptr] {} inputdata
15 regsub -all -- {[[:space
:]]+} $inputdata { } inputdata
16 string trim
$inputdata
17 if {[catch {eval $inputdata}]} {
18 bgerror [mc
"Input file has syntax errors"]
22 ################ MAXTkmaxima tkmaxima
23 if {$tcl_platform(platform
) == "windows" } {
24 set dir
[file dir
[info name
]]
25 # These should be in the same directory as the xmaxima.exe
26 set maxima_priv
(kill
) [file join $dir winkill.exe
]
27 set file [file join $dir tclwinkill.dll
]
28 if {[file isfile
$file]} {catch {load $file}}
32 set maxima_priv
(kill
) kill
}
35 # proc exit {{val "0"}} {maxExit "" $val}
36 ####### tkmaxima install
38 wm title .
[mc
{Xmaxima
: console}]
40 ### replacemen for old object gui
41 if {$tcl_platform(platform
) == "windows" && \
42 [info commands winico
] != ""} {
44 $maxima_priv(maxima_xmaximadir
) \
46 if {[file isfile
$file]} {
47 set ico
[winico createfrom
$file]
48 winico setwindow .
$ico}}
50 if {[winfo exists
$fr]} {catch { destroy $fr }}
51 # Creates the Maxima console
52 set w
[createConsole
$fr]
55 # Creates the browser in a separate window
56 if {$maxima_default(browser
)} {createBrowser .browser
}
58 ### end of replacement o object gui
60 #mike Defer looking for maxima until the interface has been built
63 #mike Defer the starting of maxima until the interface has been built
64 if {[catch {runOneMaxima
$w} err
]} {
65 tide_failure
[concat [mc
"Error starting Maxima:"] "\n$err"]
68 after idle
focus $maxima_priv(cConsoleText
)