+2001-06-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tkcon.tcl: (InitUI) added WM_DELETE_WINDOW hook to exit to
+ correctly deconstruct slave consoles.
+ (tkcon congets/getc) added tkcon show to ensure that tkcon would
+ be displayed when input is expected.
+ (GetSelection) new command to handle getting selection, this
+ supports the new UTF8_STRING type.
+
2001-05-28 Jeff Hobbs <jeffh@ActiveState.com>
* docs/start.html: added note about ::tkcon::OPT(gets) var.
2001-05-04 Jeff Hobbs <jeffh@ActiveState.com>
+ TKCON 2.1 RELEASE
+
* docs/style.css: new file for html files to use.
* README.txt:
* index.html:
if {!$PRIV(WWW)} {
wm withdraw $root
}
+ wm protocol $root WM_DELETE_WINDOW exit
set PRIV(base) $w
## Text Console
if {[winfo exists $w]} {
wm deiconify $w
} else {
- global tk_patchLevel tcl_patchLevel tcl_platform
+ global tk_patchLevel tcl_patchLevel
toplevel $w
wm title $w "About tkcon v$PRIV(version)"
button $w.b -text Dismiss -command [list wm withdraw $w]
if {[llength $args]} {
return -code error "wrong # args: must be \"tkcon congets\""
}
+ tkcon show
set old [bind TkConsole <<TkCon_Eval>>]
bind TkConsole <<TkCon_Eval>> { set ::tkcon::PRIV(wait) 0 }
set w $::tkcon::PRIV(console)
if {[llength $args]} {
return -code error "wrong # args: must be \"tkcon getcommand\""
}
+ tkcon show
set old [bind TkConsole <<TkCon_Eval>>]
bind TkConsole <<TkCon_Eval>> { set ::tkcon::PRIV(wait) 0 }
set w $::tkcon::PRIV(console)
bind TkConsole <$paste> {::tkcon::Paste %W}
}
+ proc ::tkcon::GetSelection {w} {
+ if {
+ ![catch {selection get -displayof $w -type UTF8_STRING} txt] ||
+ ![catch {selection get -displayof $w} txt] ||
+ ![catch {selection get -displayof $w -selection CLIPBOARD} txt]
+ } {
+ return $txt
+ }
+ return -code error "could not find default selection"
+ }
+
proc ::tkcon::Cut w {
if {[string match $w [selection own -displayof $w]]} {
clipboard clear -displayof $w
}
}
proc ::tkcon::Paste w {
- if {
- ![catch {selection get -displayof $w} txt] ||
- ![catch {selection get -displayof $w -selection CLIPBOARD} txt]
- } {
+ if {![catch {GetSelection $w} txt]} {
if {[$w compare insert < limit]} { $w mark set insert end }
$w insert insert $txt
$w see insert
::tkcon::ClipboardKeysyms <Copy> <Cut> <Paste>
bind TkConsole <Insert> {
- catch { ::tkcon::Insert %W [selection get -displayof %W] }
+ catch { ::tkcon::Insert %W [::tkcon::GetSelection %W] }
}
bind TkConsole <Triple-1> {+
bind TkConsole <ButtonRelease-2> {
if {
(!$tkPriv(mouseMoved) || $tk_strictMotif) &&
- ![catch {selection get -displayof %W} ::tkcon::PRIV(tmp)]
+ ![catch {::tkcon::GetSelection %W} ::tkcon::PRIV(tmp)]
} {
if {[%W compare @%x,%y < limit]} {
%W insert end $::tkcon::PRIV(tmp)