Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 tclsh-8.4.2.lha for the Amiga: Is there support for tk?

closed-wont-fix
None
7
47 minutes ago
2003-03-12
Anonymous
No

jimbot@frontiernet.net Sez:

tclsh V8.4.2 for the Amiga does not understand the
following script & chokes on the keyword wm & toplevel:

#!/bin/sh
# the next line restarts using wish \ exec wish "$0" "$@"

# SqueakGUI --
# Simple Tk script to create a GUI for setting Squeak
V2.8 options &
# selecting the image file to use in starting Squeak
V2.8
# If anyone more versed in the nuances of Tcl/Tk wishes
to improve
# this script, please send me your changes:
jimbot@frontiernet.net

global imagedir
global confFile

set font {Helvetica 14}
set imagedir /usr/local/lib/squeak/2.8
set confFile /usr/local/lib/squeak/2.8/squeak.conf

wm title . "Squeak V2.8 GUI Front-End:"

# Spaceholders for the widgets:
label .b1 -text " "
label .b2 -text " "
label .b3 -text " "
label .b4 -text " "
label .b5 -text " "
label .b6 -text " "
label .b7 -text " "
label .b8 -text " "
label .b9 -text " "
label .b10 -text " "
label .b11 -text " "
label .b12 -text " "
label .b13 -text " "
label .b14 -text " "

# ---------- Some fancy imagery
----------------------------------------
set prgmLogo "$imagedir/images/squeaklogo.gif"
set tclLogo "$imagedir/images/Tcllogo64.gif"

catch {image delete imageTclLogo}
image create photo imageTclLogo -format GIF -file
$tclLogo
label .tclimagelbl -image imageTclLogo -relief raised

catch {image delete imagesqLogo}
image create photo imagesqLogo -format GIF -file
$prgmLogo
label .sqimagelbl -image imagesqLogo -relief raised
#
-------------------------------------------------------
---------------

label .msg -font $font -justify left -text "Set
options, select an image file:"

global alignchk
global bwindowchk
global displaychk
global headlesschk
global helpchk
global lazychk
global nojitchk
global memorychk
global securechk
global spychk
global scrtype
global versionchk
global xasyncchk
global xshmchk

checkbutton .align -variable alignchk -text
-align -relief flat
checkbutton .help -variable helpchk -text -help
-relief flat
checkbutton .headless -variable headlesschk -text
-headless -relief flat
checkbutton .lazy -variable lazychk -text -lazy
-relief flat
checkbutton .nojit -variable nojitchk -text
-nojit -relief flat
checkbutton .secure -variable securechk -text
-secure -relief flat
checkbutton .spy -variable spychk -text -spy
-relief flat
checkbutton .xasync -variable xasyncchk -text
-xasync -relief flat
checkbutton .xshm -variable xshmchk -text -xshm
-relief flat
checkbutton .version -variable versionchk -text
-version -relief flat
checkbutton .memory -variable memorychk -text
-memory -relief flat
checkbutton .display -variable displaychk -text
-display -relief flat
checkbutton .bwindow -variable bwindowchk -text
-browserWindow -relief flat

radiobutton .fullscreen -text -fullscreen -variable
scrtype -value 1 -relief flat
radiobutton .notitle -text -notitle -variable
scrtype -value 2 -relief flat
radiobutton .normal -text "normal window" -variable
scrtype -value 0 -relief flat

# --------------- User-supplied strings:
---------------------------------------------
global imageName
global scriptName
global scriptArgs

label .imagelbl -text "Select an image file to open: "
entry .imageent -textvariable imageName -width 30
button .imagebut -text "Browse ..." -command
"fileDialog . .imageent image $imagedir"

label .scriptlbl -text "Select a script file to open:
"
entry .scriptent -textvariable scriptName -width 30
button .scriptbut -text "Browse ..." -command
"fileDialog . .scriptent script $imagedir"

label .scriptalbl -text "Enter any script arguments: "
entry .scriptaent -textvariable scriptArgs -width 30

# --------------- User-supplied argument strings:
------------------------------------
global memorySize
global serverName
global browserID
global alignNum

entry .alignment -textvariable alignNum -width 10
entry .memsize -textvariable memorySize -width 10
entry .serverID -textvariable serverName -width 20
entry .bwindowID -textvariable browserID -width 20

button .cancel -text Cancel -command
"destroy ."
button .start -text "Start Squeaking!" -command
"runSqueak ."

# -------------- Layout the widgets:
-------------------------------------------------
grid .sqimagelbl .msg -sticky w

grid .help .b3 .fullscreen -sticky w
grid .headless .b4 .notitle -sticky w
grid .lazy .b5 .normal -sticky w
grid .nojit -sticky w
grid .secure -sticky w
grid .spy .align .alignment -sticky w
grid .xasync .memory .memsize .b8 -sticky w
grid .xshm .display .serverID -sticky w
grid .version .bwindow .bwindowID -sticky w
grid .b12 -sticky w
grid .imagelbl .imageent .imagebut -sticky w
grid .b9
grid .scriptlbl .scriptent .scriptbut -sticky w
grid .scriptalbl .scriptaent -sticky w
grid .b1 .b2 .tclimagelbl -sticky e
grid .b6
grid .start .b7 .cancel -sticky e
grid .b10 -sticky w

# -------------- Procedures used by this script:
--------------------------------------

proc fileDialog {w entwidget filetype dir} {
# Type names Extension(s) Mac
File Type(s)
#

#------------------------------------------------------
---
set types {
{"Image Files" {.image}
}
{"Script Files" {.sq} }
{"All files" * }
}

# if ![string compare $tcl_platform(platform)
linux] {
set tk_strictMotif 1
# }

if {$filetype == "image"} {
set file [tk_getOpenFile -filetypes
$types -parent $w \ -initialfile Squeak2.8.image
-initialdir $dir -defaultextension .image]
} else {
set file [tk_getOpenFile -filetypes
$types -parent $w \ -initialfile Untitled
-defaultextension .sq]
}

if [string compare $entwidget ""] {

$entwidget delete 0 end
$entwidget insert 0 $file
$entwidget xview end
}
}

proc buildCommand {} {

global imagedir
global alignchk
global bwindowchk
global displaychk
global headlesschk
global helpchk
global lazychk
global memorychk
global nojitchk
global securechk
global spychk
global scrtype
global versionchk
global xasyncchk
global xshmchk
global imageName
global scriptName
global scriptArgs
global memorySize
global serverName
global browserID

set cmd "$imagedir/squeak"

if {$helpchk == 1} {
set cmd "$cmd -help"
puts stdout $cmd
eval exec $cmd
exit 0
}

if {$versionchk == 1} {
set cmd "$cmd -version"
eval exec $cmd
exit 0
}

if {$memorychk == 1} {
set cmd "$cmd -memory $memorySize"
}

if {$alignchk == 1} {
set cmd "$cmd -align $alignNum"
}

if {$bwindowchk == 1} {
set cmd "$cmd -browserWindow
$browserID"
}

if {$displaychk == 1} {
set cmd "$cmd -display $serverName"
}

if {$headlesschk == 1} {
set cmd "$cmd -headless"
}

if {$lazychk == 1} {
set cmd "$cmd -lazy"
}

if {$nojitchk == 1} {
set cmd "$cmd -nojit"
}

if {$securechk == 1} {
set cmd "$cmd -secure"
}

if {$spychk == 1} {
set cmd "$cmd -spy"
}

if {$xshmchk == 1} {
set cmd "$cmd -xshm"
}

if {$xasyncchk == 1} {
set cmd "$cmd -xasync"
}

if {$scrtype == 1} {
set cmd "$cmd -fullscreen"
} elseif {$scrtype == 2} {
set cmd "$cmd -notitle"
}

if {[string length $imageName] > 0} {
set cmd "$cmd $imageName"
} else {

}

if {[string length $scriptName] > 0} {
set cmd "$cmd $scriptName"
if {[string length $scriptArgs] > 0} {
set cmd "$cmd $scriptArgs"
}
}

eval exec $cmd
exit 0
}

proc runSqueak {w} {

global confFile

buildCommand
saveConfig $confFile;# store the last
configuration.
}

proc readConfig {filename} {

global alignchk
global bwindowchk
global displaychk
global headlesschk
global helpchk
global lazychk
global memorychk
global nojitchk
global securechk
global spychk
global scrtype
global versionchk
global xasyncchk
global xshmchk
global imageName
global scriptName
global scriptArgs
global memorySize
global serverName
global browserID

if ![file exists $filename] {
return 1
} else {

set readFile [open $filename r]

gets $readFile alignchk
gets $readFile alignNum
gets $readFile bwindowchk
gets $readFile browserID
gets $readFile displaychk
gets $readFile serverName
gets $readFile headlesschk
gets $readFile helpchk
gets $readFile lazychk
gets $readFile memorychk
gets $readFile memorySize
gets $readFile nojitchk
gets $readFile securechk
gets $readFile spychk
gets $readFile versionchk
gets $readFile xasyncchk
gets $readFile xshmchk
gets $readFile scrtype

gets $readFile imageName
gets $readFile scriptName
gets $readFile scriptArgs

close $readFile
}
}

proc saveConfig {filename} {

global alignchk
global alignNum
global bwindowchk
global displaychk
global headlesschk
global helpchk
global lazychk
global memorychk
global nojitchk
global securechk
global spychk
global scrtype
global versionchk
global xasyncchk
global xshmchk
global imageName
global scriptName
global scriptArgs
global memorySize
global serverName
global browserID

set writeFile [open $filename w]

puts $writeFile $alignchk
puts $writeFile $alignNum
puts $writeFile $bwindowchk
puts $writeFile $browserID
puts $writeFile $displaychk
puts $writeFile $serverName
puts $writeFile $headlesschk
puts $writeFile $helpchk
puts $writeFile $lazychk
puts $writeFile $memorychk
puts $writeFile $memorySize
puts $writeFile $nojitchk
puts $writeFile $securechk
puts $wrtieFile $spychk
puts $writeFile $versionchk
puts $writeFile $xasyncchk
puts $writeFile $xshmchk
puts $writeFile $scrtype

puts $writeFile $imageName
puts $writeFile $scriptName
puts $writeFile $scriptArgs

close $writeFile
}

# aboutBox --
#
# Pops up a message box with an "about" message
#
proc aboutBox {} {
tk_messageBox -icon info -type ok -title "About
squeakGUI" -message \ "Tcl/Tk GUI front-end for SqueakV2.8\n\n\ Copyright (c) 2001 Jim Steichen"
}

readConfig $confFile

This Tk script runs fine on Linux & Windows 98SE.
Several test scripts for Tk were tried & they failed as
well.
Jim Steichen, author of AmigaTalk

Discussion

  • Diego Casorran
    Diego Casorran
    2003-03-14

    • priority: 5 --> 7
    • assigned_to: nobody --> diegocr
     
  • Diego Casorran
    Diego Casorran
    2003-03-14

    Logged In: YES
    user_id=358695

    No, sorry!.. there are the link library LibTk.a but no support for native GUIs.

     
  • Diego Casorran
    Diego Casorran
    2003-03-21

    • status: open --> closed-wont-fix