TclApps Library Source Code
Check-in [979cc3686d]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:* tkchat.tcl: Simplify ::tkchat::GoogleSelection and fix the bindings that call it. It now also works for selections in windows outside of tkchat.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 979cc3686ddcd992a5d9da51938de512c9cbf598
User & Date: rmax 2009-01-14 14:40:31
Context
2009-01-29
20:45
Doh. Stupid typos check-in: 1d7b754923 user: patthoyts tags: trunk
2009-01-14
14:40
* tkchat.tcl: Simplify ::tkchat::GoogleSelection and fix the bindings that call it. It now also works for selections in windows outside of tkchat. check-in: 979cc3686d user: rmax tags: trunk
2009-01-02
11:32
Adjust max length to accomodate \r\n check-in: 8032a4f47b user: patthoyts tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to apps/tkchat/ChangeLog.







1
2
3
4
5
6
7





2008-12-24  Pat Thoyts  <[email protected]>

	* tkchat.tcl: Some fixes for vista look.

2008-11-13  Pat Thoyts  <[email protected]>

	* tkchat.tcl: Added option to show whispered (xmpp normal)
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2009-01-14  Reinhard Max  <[email protected]>

	* tkchat.tcl: Simplify ::tkchat::GoogleSelection and fix the
	bindings that call it. It now also works for selections in windows
	outside of tkchat.

2008-12-24  Pat Thoyts  <[email protected]>

	* tkchat.tcl: Some fixes for vista look.

2008-11-13  Pat Thoyts  <[email protected]>

	* tkchat.tcl: Added option to show whispered (xmpp normal)

Changes to apps/tkchat/tkchat.tcl.

254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
....
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
....
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
    }
}

namespace eval ::tkchat {
    variable chatWindowTitle "The Tcler's Chat"

    variable HEADUrl {http://tcllib.cvs.sourceforge.net/*checkout*/tcllib/tclapps/apps/tkchat/tkchat.tcl?revision=HEAD}
    variable rcsid   {$Id: tkchat.tcl,v 1.454 2008/12/24 01:27:28 patthoyts Exp $}

    variable MSGS
    set MSGS(entered) [list \
	    "%user% has entered the chat!" \
	    "Out of a cloud of smoke, %user% appears!" \
	    "%user% saunters in." \
	    "%user% wanders in." \
................................................................................
	$m add command \
            -label [mc "Clear bookmarks"] \
            -command ::tkchat::BookmarkClear
    }
    $m add command \
        -label [mc "Google selection"] \
        -accelerator Ctrl-G \
        -command [list ::tkchat::GoogleSelection $w]
    $m add command \
        -label [string map {& {}} [mc "Open &paste dialog"]] \
        -accelerator Ctrl-P \
        -command [list ::tkchat::PasteDlg]

    if { ![winfo exists .mbar.help.tr] } {
	$m add command -label [mc "Initialize translation"] \
            -command ::tkchat::babelfishMenu
    } else {
	.mbar.help.tr clone $m.tr
	$m add cascade -label [mc "Translate selection"] -menu $m.tr
................................................................................
	.txt tag configure MSG	-lmargin2 $width
	if { $::Options(AutoScroll) } {
	    .txt see end
	}
    }
}

proc ::tkchat::GoogleSelection { w } {
    set sel [$w tag ranges sel]
    set t [$w get [lindex $sel 0] [lindex $sel 1]]
    gotoURL http://www.google.com/search?ie=UTF-8&oe=UTF-8&[::http::formatQuery q $t]
}

# -------------------------------------------------------------------------

# NoisyUsers







|







 







|



|







 







|
|
<







254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
....
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
....
6809
6810
6811
6812
6813
6814
6815
6816
6817

6818
6819
6820
6821
6822
6823
6824
    }
}

namespace eval ::tkchat {
    variable chatWindowTitle "The Tcler's Chat"

    variable HEADUrl {http://tcllib.cvs.sourceforge.net/*checkout*/tcllib/tclapps/apps/tkchat/tkchat.tcl?revision=HEAD}
    variable rcsid   {$Id: tkchat.tcl,v 1.455 2009/01/14 14:40:32 rmax Exp $}

    variable MSGS
    set MSGS(entered) [list \
	    "%user% has entered the chat!" \
	    "Out of a cloud of smoke, %user% appears!" \
	    "%user% saunters in." \
	    "%user% wanders in." \
................................................................................
	$m add command \
            -label [mc "Clear bookmarks"] \
            -command ::tkchat::BookmarkClear
    }
    $m add command \
        -label [mc "Google selection"] \
        -accelerator Ctrl-G \
        -command ::tkchat::GoogleSelection
    $m add command \
        -label [string map {& {}} [mc "Open &paste dialog"]] \
        -accelerator Ctrl-P \
        -command ::tkchat::PasteDlg

    if { ![winfo exists .mbar.help.tr] } {
	$m add command -label [mc "Initialize translation"] \
            -command ::tkchat::babelfishMenu
    } else {
	.mbar.help.tr clone $m.tr
	$m add cascade -label [mc "Translate selection"] -menu $m.tr
................................................................................
	.txt tag configure MSG	-lmargin2 $width
	if { $::Options(AutoScroll) } {
	    .txt see end
	}
    }
}

proc ::tkchat::GoogleSelection { } {
    set t [string trim [selection get]]

    gotoURL http://www.google.com/search?ie=UTF-8&oe=UTF-8&[::http::formatQuery q $t]
}

# -------------------------------------------------------------------------

# NoisyUsers