Tk Library Source Code

Artifact [e2d4980dc7]
Login

Artifact e2d4980dc760128493c732ec6c15d1de764a1b54:

Attachment "tkchat.diff" to ticket [467876ffff] added by stevecassidy 2001-10-04 20:49:51.
*** tkchat2.tcl	Thu Oct  4 23:20:25 2001
--- tkchat.tcl	Thu Oct  4 23:47:44 2001
***************
*** 563,570 ****
  	    set festival [open "|festival --pipe" w]
  	}
  
! 	puts [string map [list "\"" ""] $message]
! 	puts $festival "(SayText \"$message\")"
  	flush $festival
      }
  }
--- 563,569 ----
  	    set festival [open "|festival --pipe" w]
  	}
  
! 	puts $festival "(SayText \"[string map [list "\"" ""] $message]\")"
  	flush $festival
      }
  }
***************
*** 679,712 ****
  }
  
  proc showInfo {title str} {
!     set t .infobox
!     set i 0
!     while {[winfo exists $t]} {
! 	set t .infobox[incr i]
!     }
!     toplevel $t
!     wm title $t $title
!     set height [expr {[string length $str] / 75 + 1}]
!     if {[set lines [regexp -all "\n" $str]] > $height} {
! 	set height $lines
!     }
!     text $t.txt -cursor left_ptr -wrap word -height $height -font NAME
!     pack $t.txt -expand 1 -fill both
!     bind $t.txt <1> { focus %W }
!     $t.txt tag config URL -underline 1
!     $t.txt tag bind URL <Enter> "$t.txt config -cursor hand2"
!     $t.txt tag bind URL <Leave> "$t.txt config -cursor left_ptr"
!     foreach {str url} [parseStr $str] {
! 	set str [string map [list "\n" "\n\t"] $str]
! 	if {$url == ""} {
! 	    $t.txt insert end "$str "
! 	} else {
! 	    $t.txt insert end "$str " [list URL URL-[incr ::URLID]]
! 	    $t.txt tag bind URL-$::URLID <1> [list gotoURL $url]
  	}
!     }
!     $t.txt insert end "\n"
!     $t.txt config -state disabled
  }
  
  proc addHelp {clr name str} {
--- 678,718 ----
  }
  
  proc showInfo {title str} {
!     global shownInfo
! 
!     # show this info in a toplevel if it's not already shown
!     # how do we know? Use a hash on the string...
!     if { ![info exists shownInfo($str)] } {
! 	set t .infobox 
! 	set i 0
! 	while {[winfo exists $t]} {
! 	    set t .infobox[incr i]
  	}
! 	toplevel $t
! 	wm title $t $title
! 	set height [expr {[string length $str] / 75 + 1}]
! 	if {[set lines [regexp -all "\n" $str]] > $height} {
! 	    set height $lines
! 	}
! 	text $t.txt -cursor left_ptr -wrap word -height $height -font NAME
! 	pack $t.txt -expand 1 -fill both
! 	bind $t.txt <1> { focus %W }
! 	$t.txt tag config URL -underline 1
! 	$t.txt tag bind URL <Enter> "$t.txt config -cursor hand2"
! 	$t.txt tag bind URL <Leave> "$t.txt config -cursor left_ptr"
! 	foreach {str url} [parseStr $str] {
! 	    set str [string map [list "\n" "\n\t"] $str]
! 	    if {$url == ""} {
! 		$t.txt insert end "$str "
! 	    } else {
! 		$t.txt insert end "$str " [list URL URL-[incr ::URLID]]
! 		$t.txt tag bind URL-$::URLID <1> [list gotoURL $url]
! 	    }
! 	}
! 	$t.txt insert end "\n"
! 	$t.txt config -state disabled
! 	set shownInfo($str) 1
!     } 
  }
  
  proc addHelp {clr name str} {