From: Jeff Hobbs Date: Thu, 27 Dec 2012 23:06:24 +0000 (+0000) Subject: * tkcon.tcl (edit): add support for ::tkcon::OPT(tabspace) to X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=c00d4d89caff975db35a9ce29d2fc2bc58876445;p=tkcon * tkcon.tcl (edit): add support for ::tkcon::OPT(tabspace) to adjust tab spacing in edit window (default: 8). [Bug #7] --- diff --git a/ChangeLog b/ChangeLog index fa8fabb..fae07c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-12-27 Jeff Hobbs + * tkcon.tcl (edit): add support for ::tkcon::OPT(tabspace) to + adjust tab spacing in edit window (default: 8). [Bug #7] + * tkcon.tcl (::tkcon::Bindings): minimal patch for 8.6b3+ event compatibility. Larger patch to come that addresses shift towards virtual events in core widgets. [Bug #48] (gollwitzer) diff --git a/tkcon.tcl b/tkcon.tcl index 05b9e5d..c859a54 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -150,6 +150,7 @@ proc ::tkcon::Init {args} { slaveeval {} slaveexit close subhistory 1 + tabspace 8 gc-delay 60000 gets {congets} overrideexit 1 @@ -3830,6 +3831,7 @@ proc tkcon_gets args { proc edit {args} { variable ::tkcon::PRIV variable ::tkcon::COLOR + variable ::tkcon::OPT array set opts {-find {} -type {} -attach {} -wrap {none}} while {[string match -* [lindex $args 0]]} { @@ -3888,11 +3890,14 @@ proc edit {args} { -foreground $COLOR(stdin) \ -background $COLOR(bg) \ -insertbackground $COLOR(cursor) \ - -font $::tkcon::OPT(font) -borderwidth 1 -highlightthickness 0 + -font $::tkcon::OPT(font) -borderwidth 1 -highlightthickness 0 \ + -undo 1 catch { - # 8.4+ stuff - $w.text configure -undo 1 + # 8.5+ stuff + set tabsp [expr {$OPT(tabspace) * [font measure $OPT(font) 0]}] + $w.text configure -tabs [list $tabsp left] -tabstyle wordprocessor } + scrollbar $w.sx -orient h -command [list $w.text xview] scrollbar $w.sy -orient v -command [list $w.text yview]