Add symbol checks to translators for MCALL, MARRAYREF, and MARRAYSET
[maxima.git] / interfaces / xmaxima / Tkmaxima / Tkmaxima.tcl
blob01fe4a99aa1fe012d721f7c83e3ca4f5a0d97669
1 ############################################################
2 # Tkmaxima.tcl #
3 # Copyright (C) 1998 William F. Schelter #
4 # For distribution under GNU public License. See COPYING. #
5 # #
6 # Time-stamp: "2024-04-01 14:07:21 villate" #
7 ############################################################
9 # The Header.tcl is created by autoconf to make the xmaxima script
10 # auto executable. After the header the various tcl pieces are put together:
12 #mike The following files are prepended, and could be sourced instead.
13 # The only problem about sourcing them is that the way of finding
14 # the directory they're in may differ in a wrapped executable.
15 # Note that the order of required files may be important.
17 # Source Tkmaxima/COPYING.tcl ;# license info
18 # Source Tkmaxima/Cygwin.tcl ;# required - must not be autoloaded
19 # Source Tkmaxima/Constants.tcl ;# required - must not be autoloaded
20 # Source Tkmaxima/Preamble.tcl ;# required - must not be autoloaded
21 # Source Tkmaxima/Readdata.tcl ;# can be autoloaded
22 # Source Tkmaxima/Getdata1.tcl ;# can be autoloaded
23 # Source Tkmaxima/Macros.tcl ;# can be autoloaded
24 # Source Tkmaxima/Proxy.tcl ;# can be autoloaded
25 # Source Tkmaxima/Send-some.tcl ;# sets global variables
26 # Source Tkmaxima/Plotting.tcl ;# sets global variables
27 # Source Tkmaxima/Fonts.tcl ;# sets global variables
28 # Source Tkmaxima/colors.tcl
29 # Source Tkmaxima/Private.tcl ;# can be autoloaded
30 # Source Tkmaxima/Getopt.tcl ;# can be autoloaded
31 # Source Tkmaxima/Parse.tcl ;# sets global variables
32 # Source Tkmaxima/Textinsert.tcl ;# can be autoloaded
33 # Source Tkmaxima/Printops.tcl ;# can be autoloaded
34 # Source Tkmaxima/Push.tcl ;# can be autoloaded
35 # Source Tkmaxima/Plotconf.tcl ;# can be autoloaded
36 # Source Tkmaxima/Adams.tcl ;# can be autoloaded
37 # Source Tkmaxima/Rk.tcl ;# can be autoloaded
38 # Source Tkmaxima/Plotdf.tcl ;# can be autoloaded
39 # Source Tkmaxima/Plot2d.tcl ;# defined globals
40 # Source Tkmaxima/Matrix.tcl ;# can be autoloaded
41 # Source Tkmaxima/Plot3d.tcl ;# defined globals
42 # Source Tkmaxima/scene.tcl ;# can be autoloaded
43 # Source Tkmaxima/NPlot3d.tcl ;# can be autoloaded
44 # Source Tkmaxima/EOctave.tcl ;# can be autoloaded
45 # Source Tkmaxima/EOpenplot.tcl ;# can be autoloaded
46 # Source Tkmaxima/EMaxima.tcl ;# can be autoloaded
47 # Source Tkmaxima/EHref.tcl ;# can be autoloaded
48 # Source Tkmaxima/Browser.tcl ;# defines globals
49 # Source Tkmaxima/Bindings.tcl ;# defines bindings
50 # Source Tkmaxima/Wmenu.tcl ;# can be autoloaded
51 # Source Tkmaxima/Myhtml.tcl ;# defines globals and tags
52 # Source Tkmaxima/Myhtml1.tcl ;# can be autoloaded
53 # Source Tkmaxima/Base64.tcl ;# can be autoloaded
54 # Source Tkmaxima/Bitmaps.tcl ;# defines globals
55 # Source Tkmaxima/Tryembed.tcl ;# defines globals?
56 # Source Tkmaxima/OpenMath.tcl ;# active
57 # Source Tkmaxima/NConsole.tcl ;# can be autoloaded
58 # Source Tkmaxima/String.tcl ;# can be autoloaded
59 # Source Tkmaxima/Prefs.tcl ;# can be autoloaded
60 # Source Tkmaxima/RunMaxima.tcl ;# can be autoloaded
61 # Source Tkmaxima/Menu.tcl
62 # Source Tkmaxima/Paths.tcl
63 # Source Tkmaxima/Gui.tcl
64 # Source Tkmaxima/Tkmaxima.tcl
66 proc vMaxUsage {script {error {}}} {
67 set msg [mc "$error\n\nUsage: $script \[options\] \[filenames\]
69 Options:
70 -h,
71 --help Display this message
72 --url <site> Start browser at site
73 -u <ver>,
74 --use-version <ver> Launch maxima version ver
75 -l <flavor>,
76 --lisp <flavor> Use lisp implementation flavor
77 -X <Lisp options>
78 --lisp-options <Lisp options> Options to be given to the underlying Lisp.
79 Option lines containing spaces have to be
80 quoted to be passed to the lisp as a whole.
82 # Originally this program output a graphical message box instead of a message
83 # on stdout - which looked nice, but is nonstandard => Replaced it by a
84 # text-only message.
86 # tk_messageBox -type ok -icon info -title "Usage" -message $msg -parent .
87 puts $msg
88 exit
91 proc lMaxInitSetOpts {} {
92 global maxima_priv argv argv0
93 set maxima_priv(opts) {}
94 set maxima_priv(plotfile) {}
95 set state key
96 foreach arg $argv {
97 switch -- $state {
98 key {
99 switch -regexp -- $arg {
100 {^--help$} {vMaxUsage $argv0}
101 {^-h(elp)?$} {vMaxUsage $argv0}
102 {^-(-)?url$} {set state url}
103 {^-u(se-version)?$} {set state version}
104 {^--use-version$} {set state version}
105 {^-l(isp)?$} {set state lisp}
106 {^--lisp$} {set state lisp}
107 {^--lisp-options$} {set state lispoptions}
108 {^-X$} {set state lispoptions}
109 {^--$} {set state noopts}
110 {^-.*} {vMaxUsage $argv0 "Unknown option $arg"}
111 default {
112 lappend maxima_priv(plotfile) $arg
113 set state file
117 file {
118 switch -glob -- $arg {
119 -* {vMaxUsage $argv0 "Misplaced option $arg"}
120 default {lappend plotfile $arg}
123 url {set maxima_priv(firstUrl) $arg; set state key}
124 version {lappend maxima_priv(opts) -u $arg; set state key}
125 lisp {lappend maxima_priv(opts) -l $arg; set state key}
126 lispoptions {lappend maxima_priv(opts) [format " -X \"%s\" " $arg]}
127 noopts {lappend file $arg}
133 # Exists Maxima after saving the current settings
134 proc maxExit {{text ""} {val "0"}} {
135 global maxima_priv
136 # save user settings for future sessions
137 catch {savePreferences}
138 update
139 if {$text eq ""} {
140 if {[info exists maxima_priv(cConsoleText)]} {
141 set text $maxima_priv(cConsoleText)}
142 } elseif {[catch {closeMaxima $text} err]} {
143 tk_messageBox -title Error -icon error -message $err}
144 tkexit $val}