Windows installer: Update README.txt.
[maxima.git] / interfaces / xmaxima / xmaxima-trailer.tcl
blob2a73f678ccff4a9a4f7c6164340b011722aea957
1 # xmaxima-trailer.tcl
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.
6 setMaxDir
7 cMAXINITBeforeIni
8 cMAXINITReadIni
9 cMAXINITAfterIni
11 if { [llength $maxima_priv(plotfile)] > 0 } {
12 set fptr [open [lindex $maxima_priv(plotfile) 0] r]
13 regsub -all -- {/\*.*?\*/} [read $fptr] {} inputdata
14 close $fptr
15 regsub -all -- {[[:space:]]+} $inputdata { } inputdata
16 string trim $inputdata
17 if {[catch {eval $inputdata}]} {
18 bgerror [mc "Input file has syntax errors"]
19 exit
21 } else {
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}}
29 unset file
30 } else {
31 # unix
32 set maxima_priv(kill) kill}
33 ################
34 rename exit tkexit
35 # proc exit {{val "0"}} {maxExit "" $val}
36 ####### tkmaxima install
37 wm withdraw .
38 wm title . [mc {Xmaxima: console}]
39 set fr .maxima
40 ### replacemen for old object gui
41 if {$tcl_platform(platform) == "windows" && \
42 [info commands winico] != ""} {
43 set file [file join \
44 $maxima_priv(maxima_xmaximadir) \
45 max.ico]
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]
54 wm deiconify .
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
61 vMAXSetMaximaCommand
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"]
66 return
68 after idle focus $maxima_priv(cConsoleText)