From: Jeff Hobbs Date: Tue, 1 Oct 2002 21:40:09 +0000 (+0000) Subject: * tkcon.tcl (InterpEval): correctly handle no args case. X-Git-Tag: tkcon-2-4~25 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=b946147e8d199482fa5d0dee0d27244da79da10d;p=tkcon * tkcon.tcl (InterpEval): correctly handle no args case. (New): autoload tbcload when it exists. --- diff --git a/ChangeLog b/ChangeLog index 8ca92c9..08c490b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-10-01 Jeff Hobbs + + * tkcon.tcl (InterpEval): correctly handle no args case. + (New): autoload tbcload when it exists. + 2002-06-22 Jeff Hobbs * tkcon.tcl: call Init with eval to break out argv into args. diff --git a/tkcon.tcl b/tkcon.tcl index 09b481f..55c099d 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -2013,6 +2013,9 @@ proc ::tkcon::MainInit {} { set tmp [interp create Slave[GetSlaveNum]] lappend PRIV(slaves) $tmp load {} Tk $tmp + # If we have tbcload, then that should be autoloaded into slaves. + set idx [lsearch [info loaded] "* Tbcload"] + if {$idx != -1} { catch {load {} Tbcload $tmp} } lappend PRIV(interps) [$tmp eval [list tk appname \ "[tk appname] $tmp"]] if {[info exist argv0]} {$tmp eval [list set argv0 $argv0]} @@ -2120,7 +2123,8 @@ proc ::tkcon::MainInit {} { proc ::tkcon::InterpEval {{slave {}} args} { variable PRIV - if {[string match {} $slave]} { + if {[llength [info level 0]] == 1} { + # no args given return $PRIV(slaves) } elseif {[string match {[Mm]ain} $slave]} { set slave {} @@ -2133,7 +2137,9 @@ proc ::tkcon::MainInit {} { } proc ::tkcon::Interps {{ls {}} {interp {}}} { - if {[string match {} $interp]} { lappend ls {} [tk appname] } + if {[string match {} $interp]} { + lappend ls {} [tk appname] + } foreach i [interp slaves $interp] { if {[string compare {} $interp]} { set i "$interp $i" } if {[string compare {} [interp eval $i package provide Tk]]} {