From: Jeff Hobbs Date: Mon, 12 Sep 2005 19:07:16 +0000 (+0000) Subject: * tkcon.tcl (::tkcon::AtSource): do not require argv to be defined X-Git-Tag: tkcon-2-5~24 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=6a1a38ec56de2901e6d8ce7f63012fa0e27ff907;p=tkcon * tkcon.tcl (::tkcon::AtSource): do not require argv to be defined (edit): enable text -undo in editor (::tkcon::InitUI): shrink aqua resize control space alloted --- diff --git a/ChangeLog b/ChangeLog index 3d69473..6e0c497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-09-12 Jeff Hobbs + + * tkcon.tcl (::tkcon::AtSource): do not require argv to be defined + (edit): enable text -undo in editor + (::tkcon::InitUI): shrink aqua resize control space alloted + 2005-07-14 Jeff Hobbs * tkcon.tcl: add ::tkcon::OPT(maxlinelen) (default 0 == unlimited) diff --git a/tkcon.tcl b/tkcon.tcl index a76ac40..888e538 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -599,8 +599,8 @@ proc ::tkcon::InitUI {title} { grid rowconfigure $sbar 0 -weight 1 grid rowconfigure $PRIV(tabframe) 0 -weight 1 if {$::tcl_version >= 8.4 && [tk windowingsystem] == "aqua"} { - # give space for the corner resize handle - grid columnconfigure $sbar [lindex [grid size $sbar] 0] -minsize 20 + # resize control space + grid columnconfigure $sbar [lindex [grid size $sbar] 0] -minsize 16 } ## Create console tab @@ -2384,9 +2384,9 @@ proc ::tkcon::MainInit {} { 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]} - $tmp eval set argc $argc - $tmp eval [list set argv $argv] + if {[info exists argv0]} {$tmp eval [list set argv0 $argv0]} + if {[info exists argc]} {$tmp eval [list set argc $argc]} + if {[info exists argv]} {$tmp eval [list set argv $argv]} $tmp eval [list namespace eval ::tkcon {}] $tmp eval [list set ::tkcon::PRIV(name) $tmp] $tmp eval [list set ::tkcon::PRIV(SCRIPT) $::tkcon::PRIV(SCRIPT)] @@ -3734,6 +3734,7 @@ proc edit {args} { -background $::tkcon::COLOR(bg) \ -insertbackground $::tkcon::COLOR(cursor) \ -font $::tkcon::OPT(font) + catch {$w.text configure -undo 1} scrollbar $w.sx -orient h -takefocus 0 -bd 1 \ -command [list $w.text xview] scrollbar $w.sy -orient v -takefocus 0 -bd 1 \ @@ -6255,7 +6256,7 @@ proc ::tkcon::Resource {} { ## Initialize only if we haven't yet, and do other stuff that prepares to ## run. It only actually inits (and runs) tkcon if it is the main script. ## -proc ::tkcon::AtSource {argv} { +proc ::tkcon::AtSource {} { variable PRIV # the info script assumes we always call this while being sourced @@ -6291,9 +6292,14 @@ proc ::tkcon::AtSource {argv} { if {(![info exists PRIV(root)] || ![winfo exists $PRIV(root)]) \ && (![info exists ::argv0] || $PRIV(SCRIPT) == $::argv0)} { - eval ::tkcon::Init $argv + global argv + if {[info exists argv]} { + eval ::tkcon::Init $argv + } else { + ::tkcon::Init + } } } -tkcon::AtSource $argv +tkcon::AtSource package provide tkcon $::tkcon::VERSION