diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-12-11 15:32:36 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-12-11 15:32:36 (GMT) |
commit | df2b02bddc727ff4f4e1f442ae902977376d7ea3 (patch) | |
tree | e90f23cb34e026ac3c6de406926db0a10afb611c /library/tk.tcl | |
parent | 3db2898fc0ffd5627de6404872c670f5552b23a6 (diff) | |
download | tk-df2b02bddc727ff4f4e1f442ae902977376d7ea3.zip tk-df2b02bddc727ff4f4e1f442ae902977376d7ea3.tar.gz tk-df2b02bddc727ff4f4e1f442ae902977376d7ea3.tar.bz2 |
Simplified this code following observation by Brian Griffin
Diffstat (limited to 'library/tk.tcl')
-rw-r--r-- | library/tk.tcl | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/library/tk.tcl b/library/tk.tcl index 25a6d13..e950c24 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each Tk-based # application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.87 2009/12/11 11:17:28 dkf Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.88 2009/12/11 15:32:36 dkf Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -246,12 +246,8 @@ if {$tcl_platform(platform) eq "unix"} { # screen - The name of the new screen. proc ::tk::ScreenChanged screen { - set x [string last . $screen] - if {$x > 0} { - set disp [string range $screen 0 [expr {$x - 1}]] - } else { - set disp $screen - } + # Extract the display name. + set disp [string range $screen 0 [string last . $screen]-1] # Ensure that namespace separators never occur in the display name (as # they cause problems in variable names). Double-colons exist in some VNC |