Merge branch 'master' into bug-4403-remove-polyfill
[maxima.git] / interfaces / xmaxima / Tkmaxima / Startup.tcl
blob3512cbba90d9c4f90fb214f3624d43097509dce1
1 ############################################################
2 # Startup.tcl #
3 # Copyright (C) 1998 William F. Schelter #
4 # For distribution under GNU public License. See COPYING. #
5 # #
6 # Time-stamp: "2021-04-04 12:02:54 villate" #
7 ############################################################
9 # Old startup code - unused.
11 set dontstart 1
12 if { ![info exists dontstart] } {
13 ## source "startup.tcl"
15 # try to fix up so that we dont write to stdout in the browser..
17 # source preamble.tcl
19 if { "[info command wm]" != "wm" } {
20 proc wm { args } {}
22 if { [info exists embed_args(width)] || \
23 [info exists embed_args(embed_mode)]} {
24 set ws_openMath(inbrowser) 1
25 # rebind puts
26 rename puts _joel
27 proc puts {args} {
28 global badout ;
29 switch [llength $args] {
30 2 {_joel [lindex $args 0] [lindex $args 1]}
31 1 {append badout $args}
32 3 {_joel [lindex $args 0] [lindex $args 1] [lindex $args 2]}
36 # rename flush _flush1
37 # proc flush { x } {
38 # if { "$x" != "stdout" } {
39 # _flush1 $x
40 # }
41 # }
45 set toeval "OpenMathOpenUrl http://maxima.sourceforge.net/index.html"
47 catch {
48 if { "[lindex $argv 0]" != "" } {
49 wm minsize . 500 400
50 after 7000 wm minsize . 0 0
51 set toeval "OpenMathOpenUrl [lindex $argv 0]"
54 catch { set toeval [assoc eval [getattr browserArgs]] }
56 if { [catch { eval $toeval } err ] } {
57 if { [regexp "unreachable|couldn't open" $err]
58 && (1 || [catch { socket www.yahoo.com 80 } ])
59 && (![info exists ws_openMath(proxy,http)] ||
60 [catch { eval socket $ws_openMath(proxy,http) } ]) } {
61 if { 0 == [tk_dialog .jil 0 "Connection Problem:$err" "" 0 \
62 {Configure proxy server?} {Connect Later}] } {
63 fontDialog .top
65 } else {error "$toeval:\n error: $err" }