TclApps Library Source Code
Check-in [d5edbd90fe]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment:Applied MacOSX patch from Daniel Steffen
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d5edbd90fe7602888ab68684b178d08766d09f52
User & Date: patthoyts 2009-04-09 00:37:42
Context
2009-04-22
23:15
Tightened up on the handling of jids by making use of jidsplit and jidequal check-in: 8ca38c4784 user: patthoyts tags: trunk
2009-04-09
00:37
Applied MacOSX patch from Daniel Steffen check-in: d5edbd90fe user: patthoyts tags: trunk
2009-03-10
11:30
* tkchat.tcl (::tkchat::DoAnim): Only animate GIF images. check-in: cb4e5084cb user: rmax tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to apps/tkchat/ChangeLog.





1
2
3
4
5
6
7



2009-03-10  Reinhard Max  <[email protected]>

	* tkchat.tcl (::tkchat::DoAnim): Only animate GIF images.

2009-03-04  Pat Thoyts  <[email protected]>

	* tkchat.tcl: [FR 2605849] Explicitly set the application name.
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
2009-04-09  Pat Thoyts  <[email protected]>

	* tkchat.tcl: Applied MacOSX patch from Daniel Steffen

2009-03-10  Reinhard Max  <[email protected]>

	* tkchat.tcl (::tkchat::DoAnim): Only animate GIF images.

2009-03-04  Pat Thoyts  <[email protected]>

	* tkchat.tcl: [FR 2605849] Explicitly set the application name.

Changes to apps/tkchat/tkchat.tcl.

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
....
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
....
2308
2309
2310
2311
2312
2313
2314


2315



2316
2317
2318
2319
2320
2321
2322
2323
2324






2325


2326
2327
2328
2329






2330

2331
2332
2333
2334
2335
2336
2337
....
2346
2347
2348
2349
2350
2351
2352
2353
2354

2355
2356
2357
2358
2359






2360
2361
2362

2363
2364
2365
2366
2367
2368
2369
....
2735
2736
2737
2738
2739
2740
2741

2742
2743

2744
2745
2746
2747
2748
2749
2750
        # Ffidl code + carbon hooks courtesy of Daniel Steffen - see
        # http://wiki.tcl.tk/ffidl
        catch {
            # hooks to Carbon API to set application name
            ::ffidl::callout CPSSetProcessName {pointer-byte pointer-utf8} \
                            sint32 \
                [::ffidl::symbol /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/CoreGraphics CPSSetProcessName]
              CPSSetProcessName [binary format I2 {0 2}] "TkChat"

            # hooks to Carbon API to Show + Hide process
            ::ffidl::callout ShowHideProcess {pointer-byte int} sint32 \
                    [::ffidl::symbol Carbon.framework/Carbon ShowHideProcess]
        }
    }
}

# 8.4 doesn't provide this - we use it for i18n on menus.
if {[llength [info commands ::tk::AmpMenuArgs]] == 0} {
    proc ::tk::AmpMenuArgs {widget add type args} {
................................................................................
    }
}

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.462 2009/03/10 11:30:45 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." \
................................................................................

    set top [winfo toplevel $w]
    unset -nocomplain alert_pending
    if {$Options(Alert,RAISE) && [llength [focus -displayof $top]]==0} {
	# Only call this if the window doesn't already have focus
        if {[tk windowingsystem] eq "aqua" \
            && [llength [package provide Ffidl]] > 0} {
            ShowHideProcess [binary format I2 {0 2}] 1
        }
	wm deiconify $top
	raise $top
    }
    if {$Options(Alert,SOUND)} bell
}

................................................................................
    }
    if {[info command ::tkchat::img::Tkchat] ne {}} {
        wm iconphoto . -default ::tkchat::img::Tkchat
    }
    catch { createFonts }

    menu .mbar


    . configure -menu .mbar




    menu .mbar.file  -tearoff 0
    menu .mbar.edit  -tearoff 0
    menu .mbar.emot  -tearoff 0
    menu .mbar.vis   -tearoff 0
    menu .mbar.alert -tearoff 0
    menu .mbar.dbg   -tearoff 0
    menu .mbar.help  -tearoff 0
    tk::AmpMenuArgs .mbar add cascade -label [mc "&File"] -menu .mbar.file






    tk::AmpMenuArgs .mbar add cascade -label [mc "&Preferences"] -menu .mbar.edit


    tk::AmpMenuArgs .mbar add cascade -label [mc "&Emoticons"] -menu .mbar.emot
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Visibility"] -menu .mbar.vis
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Alerts"] -menu .mbar.alert
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Debug"] -menu .mbar.dbg






    tk::AmpMenuArgs .mbar add cascade -label [mc "&Help"] -menu .mbar.help


    ## File Menu
    ##
    set m .mbar.file
    tk::AmpMenuArgs $m add command \
        -label [mc "&Login"] \
        -command ::tkchat::logonScreen
................................................................................
    $m add separator
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &whiteboard"] \
        -command ::tkchat::Whiteboard::Init
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &paste dialog"] \
        -command ::tkchat::PasteDlg
    $m add separator
    if {[tk windowingsystem] eq "x11"} {

	tk::AmpMenuArgs $m add command \
	    -label [mc "&Install application"] \
	    -command ::tkchat::InstallXDG
	$m add separator
    }






    tk::AmpMenuArgs $m add command \
        -label [mc "E&xit"] \
        -command ::tkchat::quit


    ## Preferences/Edit Menu
    ##
    set m .mbar.edit
    tk::AmpMenuArgs $m add checkbutton \
        -label [mc "&Display online users"] \
        -variable Options(DisplayUsers) \
................................................................................
        -command [list [namespace origin babelfishMenu]]
    $m add separator
    tk::AmpMenuArgs $m add command -label [mc "&Check version"] \
        -command [list after idle [list [namespace origin CheckVersion]]]
    tk::AmpMenuArgs $m add command -label [mc "&View ChangeLog..."] \
        -command [list after idle [list [namespace origin gotoURL] \
               [string map {tkchat.tcl ChangeLog} $::tkchat::HEADUrl]]]

    tk::AmpMenuArgs $m add command -label [mc "&About..."]\
        -command [list [namespace origin About]]


    # a pane for the main display (chat window and users window):
    if {$useTile} {
        if {[llength [info commands ::ttk::panedwindow]] != 0} {
            ::ttk::panedwindow .pane -orient horizontal
        } else {
            ::ttk::paned .pane -orient horizontal






|



|







 







|







 







|







 







>
>
|
>
>
>
|








>
>
>
>
>
>
|
>
>




>
>
>
>
>
>

>







 







<

>



<

>
>
>
>
>
>
|
|
|
>







 







>
|
|
>







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
....
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
....
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
....
2366
2367
2368
2369
2370
2371
2372

2373
2374
2375
2376
2377

2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
....
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
        # Ffidl code + carbon hooks courtesy of Daniel Steffen - see
        # http://wiki.tcl.tk/ffidl
        catch {
            # hooks to Carbon API to set application name
            ::ffidl::callout CPSSetProcessName {pointer-byte pointer-utf8} \
                            sint32 \
                [::ffidl::symbol /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/CoreGraphics CPSSetProcessName]
              CPSSetProcessName [binary format n2 {0 2}] "TkChat"

            # hooks to Carbon API to Show + Hide process
            ::ffidl::callout ShowHideProcess {pointer-byte int} sint32 \
                    [::ffidl::symbol /System/Library/Frameworks/Carbon.framework/Carbon ShowHideProcess]
        }
    }
}

# 8.4 doesn't provide this - we use it for i18n on menus.
if {[llength [info commands ::tk::AmpMenuArgs]] == 0} {
    proc ::tk::AmpMenuArgs {widget add type args} {
................................................................................
    }
}

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.463 2009/04/09 00:37:47 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." \
................................................................................

    set top [winfo toplevel $w]
    unset -nocomplain alert_pending
    if {$Options(Alert,RAISE) && [llength [focus -displayof $top]]==0} {
	# Only call this if the window doesn't already have focus
        if {[tk windowingsystem] eq "aqua" \
            && [llength [package provide Ffidl]] > 0} {
            ShowHideProcess [binary format n2 {0 2}] 1
        }
	wm deiconify $top
	raise $top
    }
    if {$Options(Alert,SOUND)} bell
}

................................................................................
    }
    if {[info command ::tkchat::img::Tkchat] ne {}} {
        wm iconphoto . -default ::tkchat::img::Tkchat
    }
    catch { createFonts }

    menu .mbar

    if {[tk windowingsystem] eq "aqua"} {
	menu .mbar.apple -tearoff 0
	.mbar.apple add command -label "About TkChat" \
		-command [list [namespace origin About]]
	.mbar add cascade -label Apple -menu .mbar.apple
    }
    menu .mbar.file  -tearoff 0
    menu .mbar.edit  -tearoff 0
    menu .mbar.emot  -tearoff 0
    menu .mbar.vis   -tearoff 0
    menu .mbar.alert -tearoff 0
    menu .mbar.dbg   -tearoff 0
    menu .mbar.help  -tearoff 0
    tk::AmpMenuArgs .mbar add cascade -label [mc "&File"] -menu .mbar.file
    if {[tk windowingsystem] eq "aqua"} {
	proc ::tk::mac::ShowPreferences args {
	    # a hack, till someone does a proper preferences dialog for OSX
	    .mbar.edit post 20 30
	}
    } else {
	tk::AmpMenuArgs .mbar add cascade -label [mc "&Preferences"] \
		-menu .mbar.edit
    }
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Emoticons"] -menu .mbar.emot
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Visibility"] -menu .mbar.vis
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Alerts"] -menu .mbar.alert
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Debug"] -menu .mbar.dbg
    if {[tk windowingsystem] eq "aqua"} {
	if {[lsearch -exact [winfo server .] AppKit] != -1} {
	    tk::AmpMenuArgs .mbar add cascade -label [mc "&Window"] \
		    -menu [menu .mbar.window -tearoff 0]
	}
    }
    tk::AmpMenuArgs .mbar add cascade -label [mc "&Help"] -menu .mbar.help
    . configure -menu .mbar

    ## File Menu
    ##
    set m .mbar.file
    tk::AmpMenuArgs $m add command \
        -label [mc "&Login"] \
        -command ::tkchat::logonScreen
................................................................................
    $m add separator
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &whiteboard"] \
        -command ::tkchat::Whiteboard::Init
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &paste dialog"] \
        -command ::tkchat::PasteDlg

    if {[tk windowingsystem] eq "x11"} {
	$m add separator
	tk::AmpMenuArgs $m add command \
	    -label [mc "&Install application"] \
	    -command ::tkchat::InstallXDG

    }
   if {[tk windowingsystem] eq "aqua"} {
	proc ::tk::mac::Quit args {
	    ::tkchat::quit
	}
    } else {
	$m add separator
	tk::AmpMenuArgs $m add command \
	    -label [mc "E&xit"] \
	    -command ::tkchat::quit
    }

    ## Preferences/Edit Menu
    ##
    set m .mbar.edit
    tk::AmpMenuArgs $m add checkbutton \
        -label [mc "&Display online users"] \
        -variable Options(DisplayUsers) \
................................................................................
        -command [list [namespace origin babelfishMenu]]
    $m add separator
    tk::AmpMenuArgs $m add command -label [mc "&Check version"] \
        -command [list after idle [list [namespace origin CheckVersion]]]
    tk::AmpMenuArgs $m add command -label [mc "&View ChangeLog..."] \
        -command [list after idle [list [namespace origin gotoURL] \
               [string map {tkchat.tcl ChangeLog} $::tkchat::HEADUrl]]]
    if {[tk windowingsystem] ne "aqua"} {
	tk::AmpMenuArgs $m add command -label [mc "&About..."]\
	    -command [list [namespace origin About]]
    }

    # a pane for the main display (chat window and users window):
    if {$useTile} {
        if {[llength [info commands ::ttk::panedwindow]] != 0} {
            ::ttk::panedwindow .pane -orient horizontal
        } else {
            ::ttk::paned .pane -orient horizontal