summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/bgerror.tcl9
-rw-r--r--library/button.tcl6
-rw-r--r--library/choosedir.tcl4
-rw-r--r--library/clrpick.tcl4
-rw-r--r--library/comdlg.tcl2
-rw-r--r--library/console.tcl10
-rw-r--r--library/demos/README2
-rw-r--r--library/demos/anilabel.tcl2
-rw-r--r--library/demos/aniwave.tcl2
-rw-r--r--library/demos/arrow.tcl2
-rw-r--r--library/demos/bind.tcl2
-rw-r--r--library/demos/bitmap.tcl2
-rw-r--r--library/demos/browse2
-rw-r--r--library/demos/button.tcl2
-rw-r--r--library/demos/check.tcl2
-rw-r--r--library/demos/clrpick.tcl2
-rw-r--r--library/demos/colors.tcl2
-rw-r--r--library/demos/combo.tcl2
-rw-r--r--library/demos/cscroll.tcl2
-rw-r--r--library/demos/ctext.tcl2
-rw-r--r--library/demos/dialog1.tcl2
-rw-r--r--library/demos/dialog2.tcl2
-rw-r--r--library/demos/entry1.tcl2
-rw-r--r--library/demos/entry2.tcl2
-rw-r--r--library/demos/entry3.tcl6
-rw-r--r--library/demos/filebox.tcl2
-rw-r--r--library/demos/floor.tcl2
-rw-r--r--library/demos/fontchoose.tcl2
-rw-r--r--library/demos/form.tcl2
-rw-r--r--library/demos/hello2
-rw-r--r--library/demos/hscale.tcl2
-rw-r--r--library/demos/icon.tcl2
-rw-r--r--library/demos/image1.tcl2
-rw-r--r--library/demos/image2.tcl2
-rw-r--r--library/demos/items.tcl4
-rw-r--r--library/demos/ixset2
-rw-r--r--library/demos/label.tcl2
-rw-r--r--library/demos/labelframe.tcl2
-rw-r--r--library/demos/mclist.tcl2
-rw-r--r--library/demos/menu.tcl4
-rw-r--r--library/demos/menubu.tcl2
-rw-r--r--library/demos/msgbox.tcl2
-rw-r--r--library/demos/paned1.tcl2
-rw-r--r--library/demos/paned2.tcl2
-rw-r--r--library/demos/pendulum.tcl2
-rw-r--r--library/demos/plot.tcl2
-rw-r--r--library/demos/puzzle.tcl2
-rw-r--r--library/demos/radio.tcl2
-rw-r--r--library/demos/rmt2
-rw-r--r--library/demos/rolodex2
-rw-r--r--library/demos/ruler.tcl2
-rw-r--r--library/demos/sayings.tcl2
-rw-r--r--library/demos/search.tcl2
-rw-r--r--library/demos/spin.tcl2
-rw-r--r--library/demos/square2
-rw-r--r--library/demos/states.tcl2
-rw-r--r--library/demos/style.tcl2
-rw-r--r--library/demos/tcolor2
-rw-r--r--library/demos/text.tcl8
-rw-r--r--library/demos/textpeer.tcl2
-rw-r--r--library/demos/timer2
-rw-r--r--library/demos/toolbar.tcl69
-rw-r--r--library/demos/tree.tcl2
-rw-r--r--library/demos/ttkbut.tcl2
-rw-r--r--library/demos/ttkmenu.tcl2
-rw-r--r--library/demos/ttknote.tcl2
-rw-r--r--library/demos/ttkpane.tcl2
-rw-r--r--library/demos/ttkprogress.tcl2
-rw-r--r--library/demos/ttkscale.tcl2
-rw-r--r--library/demos/twind.tcl2
-rw-r--r--library/demos/unicodeout.tcl2
-rw-r--r--library/demos/vscale.tcl2
-rw-r--r--library/demos/widget2
-rw-r--r--library/dialog.tcl24
-rw-r--r--library/entry.tcl34
-rw-r--r--library/focus.tcl2
-rw-r--r--library/fontchooser.tcl2
-rw-r--r--library/iconlist.tcl10
-rw-r--r--library/icons.tcl3
-rw-r--r--library/images/README5
-rw-r--r--library/listbox.tcl30
-rw-r--r--library/megawidget.tcl2
-rw-r--r--library/menu.tcl169
-rw-r--r--library/mkpsenc.tcl1
-rw-r--r--library/msgbox.tcl4
-rw-r--r--library/obsolete.tcl2
-rw-r--r--library/optMenu.tcl2
-rw-r--r--library/palette.tcl2
-rw-r--r--library/panedwindow.tcl3
-rw-r--r--library/safetk.tcl2
-rw-r--r--library/scale.tcl24
-rw-r--r--library/scrlbar.tcl22
-rw-r--r--library/spinbox.tcl32
-rw-r--r--library/tearoff.tcl2
-rw-r--r--library/text.tcl82
-rw-r--r--library/tk.tcl157
-rw-r--r--library/tkfbox.tcl133
-rw-r--r--library/ttk/altTheme.tcl2
-rw-r--r--library/ttk/aquaTheme.tcl2
-rw-r--r--library/ttk/button.tcl2
-rw-r--r--library/ttk/clamTheme.tcl2
-rw-r--r--library/ttk/classicTheme.tcl2
-rw-r--r--library/ttk/combobox.tcl9
-rw-r--r--library/ttk/cursors.tcl2
-rw-r--r--library/ttk/defaults.tcl2
-rw-r--r--library/ttk/entry.tcl16
-rw-r--r--library/ttk/fonts.tcl2
-rw-r--r--library/ttk/menubutton.tcl2
-rw-r--r--library/ttk/notebook.tcl6
-rw-r--r--library/ttk/panedwindow.tcl2
-rw-r--r--library/ttk/progress.tcl2
-rw-r--r--library/ttk/scale.tcl25
-rw-r--r--library/ttk/scrollbar.tcl2
-rw-r--r--library/ttk/sizegrip.tcl2
-rw-r--r--library/ttk/spinbox.tcl2
-rw-r--r--library/ttk/treeview.tcl3
-rw-r--r--library/ttk/ttk.tcl2
-rw-r--r--library/ttk/utils.tcl2
-rw-r--r--library/ttk/winTheme.tcl2
-rw-r--r--library/ttk/xpTheme.tcl2
-rw-r--r--library/unsupported.tcl2
-rw-r--r--library/xmfbox.tcl8
122 files changed, 389 insertions, 715 deletions
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index dec90e7..d1ed60a 100644
--- a/library/bgerror.tcl
+++ b/library/bgerror.tcl
@@ -10,9 +10,6 @@
# Copyright (c) 2007 by ActiveState Software Inc.
# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
# Copyright (c) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
-#
-# RCS: @(#) $Id: bgerror.tcl,v 1.42 2010/09/05 14:43:11 dkf Exp $
-#
namespace eval ::tk::dialog::error {
namespace import -force ::tk::msgcat::*
@@ -223,7 +220,9 @@ proc ::tk::dialog::error::bgerror err {
bind $dlg.function <Return> [namespace code {ReturnInDetails %W}]
$dlg.function configure -command [namespace code Details]
- # 6. Place the window (centered in the display) and deiconify it.
+ # 6. Withdraw the window, then update all the geometry information
+ # so we know how big it wants to be, then center the window in the
+ # display (Motif style) and de-iconify it.
::tk::PlaceWindow $dlg
@@ -234,7 +233,7 @@ proc ::tk::dialog::error::bgerror err {
# 8. Ensure that we are topmost.
raise $dlg
- if {$tcl_platform(platform) eq "windows"} {
+ if {[tk windowingsystem] eq "win32"} {
# Place it topmost if we aren't at the top of the stacking
# order to ensure that it's seen
if {[lindex [wm stackorder .] end] ne "$dlg"} {
diff --git a/library/button.tcl b/library/button.tcl
index 54929d1..a1f0a26 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -4,8 +4,6 @@
# checkbutton, and radiobutton widgets and provides procedures
# that help in implementing those bindings.
#
-# RCS: @(#) $Id: button.tcl,v 1.22 2010/08/03 23:13:03 hobbs Exp $
-#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
# Copyright (c) 2002 ActiveState Corporation.
@@ -41,7 +39,7 @@ if {[tk windowingsystem] eq "aqua"} {
tk::ButtonLeave %W
}
}
-if {"windows" eq $tcl_platform(platform)} {
+if {"win32" eq [tk windowingsystem]} {
bind Checkbutton <equal> {
tk::CheckRadioInvoke %W select
}
@@ -133,7 +131,7 @@ bind Radiobutton <Leave> {
tk::ButtonLeave %W
}
-if {"windows" eq $tcl_platform(platform)} {
+if {"win32" eq [tk windowingsystem]} {
#########################
# Windows implementation
diff --git a/library/choosedir.tcl b/library/choosedir.tcl
index 2351781..62e3165 100644
--- a/library/choosedir.tcl
+++ b/library/choosedir.tcl
@@ -4,8 +4,6 @@
#
# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
-#
-# RCS: @(#) $Id: choosedir.tcl,v 1.24 2009/02/12 21:32:49 dkf Exp $
# Make sure the tk::dialog namespace, in which all dialogs should live, exists
namespace eval ::tk::dialog {}
@@ -91,7 +89,7 @@ proc ::tk::dialog::file::chooseDir:: {args} {
# Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
- # display and de-iconify it.
+ # display (Motif style) and de-iconify it.
::tk::PlaceWindow $w widget $data(-parent)
wm title $w $data(-title)
diff --git a/library/clrpick.tcl b/library/clrpick.tcl
index 083de84..092915c 100644
--- a/library/clrpick.tcl
+++ b/library/clrpick.tcl
@@ -3,8 +3,6 @@
# Color selection dialog for platforms that do not support a
# standard color selection dialog.
#
-# RCS: @(#) $Id: clrpick.tcl,v 1.23 2010/01/19 01:27:41 patthoyts Exp $
-#
# Copyright (c) 1996 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
@@ -91,7 +89,7 @@ proc ::tk::dialog::color:: {args} {
# 5. Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
- # display and de-iconify it.
+ # display (Motif style) and de-iconify it.
::tk::PlaceWindow $w widget $data(-parent)
wm title $w $data(-title)
diff --git a/library/comdlg.tcl b/library/comdlg.tcl
index 6190fa3..39d27d3 100644
--- a/library/comdlg.tcl
+++ b/library/comdlg.tcl
@@ -3,8 +3,6 @@
# Some functions needed for the common dialog boxes. Probably need to go
# in a different file.
#
-# RCS: @(#) $Id: comdlg.tcl,v 1.14 2007/05/16 18:10:35 dgp Exp $
-#
# Copyright (c) 1996 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
diff --git a/library/console.tcl b/library/console.tcl
index d9c788b..37832f2 100644
--- a/library/console.tcl
+++ b/library/console.tcl
@@ -4,8 +4,6 @@
# can be used by non-unix systems that do not have built-in support
# for shells.
#
-# RCS: @(#) $Id: console.tcl,v 1.45 2010/01/04 14:30:50 patthoyts Exp $
-#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2007-2008 Daniel A. Steffen <das@users.sourceforge.net>
@@ -501,18 +499,16 @@ proc ::tk::ConsoleBind {w} {
}
bind Console <Control-h> [bind Console <BackSpace>]
- bind Console <Home> {
+ bind Console <<LineStart>> {
if {[%W compare insert < promptEnd]} {
tk::TextSetCursor %W {insert linestart}
} else {
tk::TextSetCursor %W promptEnd
}
}
- bind Console <Control-a> [bind Console <Home>]
- bind Console <End> {
+ bind Console <<LineEnd>> {
tk::TextSetCursor %W {insert lineend}
}
- bind Console <Control-e> [bind Console <End>]
bind Console <Control-d> {
if {[%W compare insert < promptEnd]} {
break
@@ -677,7 +673,7 @@ proc ::tk::ConsoleInsert {w s} {
proc ::tk::ConsoleOutput {dest string} {
set w .console
- $w insert output [string map {\0 \u25a1} $string] $dest
+ $w insert output $string $dest
::tk::console::ConstrainBuffer $w $::tk::console::maxLines
$w see insert
}
diff --git a/library/demos/README b/library/demos/README
index 2996cdd..7285a93 100644
--- a/library/demos/README
+++ b/library/demos/README
@@ -42,5 +42,3 @@ browse - A simple directory browser. Invoke it with and argument
giving the name of the directory you'd like to browse.
Double-click on files or subdirectories to browse them.
Control-c and control-q cause the program to exit.
-
-RCS: @(#) $Id: README,v 1.3 2003/11/05 13:20:21 dkf Exp $
diff --git a/library/demos/anilabel.tcl b/library/demos/anilabel.tcl
index dadf52e..61e6315 100644
--- a/library/demos/anilabel.tcl
+++ b/library/demos/anilabel.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# several animated label widgets.
-#
-# RCS: @(#) $Id: anilabel.tcl,v 1.2 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/aniwave.tcl b/library/demos/aniwave.tcl
index fd2b1ec..6122132 100644
--- a/library/demos/aniwave.tcl
+++ b/library/demos/aniwave.tcl
@@ -3,8 +3,6 @@
# This demonstration script illustrates how to adjust canvas item
# coordinates in a way that does something fairly similar to waveform
# display.
-#
-# RCS: @(#) $Id: aniwave.tcl,v 1.2 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/arrow.tcl b/library/demos/arrow.tcl
index 8137473..5011f6f 100644
--- a/library/demos/arrow.tcl
+++ b/library/demos/arrow.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a canvas widget that displays a
# large line with an arrowhead whose shape can be edited interactively.
-#
-# RCS: @(#) $Id: arrow.tcl,v 1.6 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/bind.tcl b/library/demos/bind.tcl
index 5e67834..d9bc22f 100644
--- a/library/demos/bind.tcl
+++ b/library/demos/bind.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a text widget with bindings set
# up for hypertext-like effects.
-#
-# RCS: @(#) $Id: bind.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/bitmap.tcl b/library/demos/bitmap.tcl
index e439d09..453987d 100644
--- a/library/demos/bitmap.tcl
+++ b/library/demos/bitmap.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window that displays
# all of Tk's built-in bitmaps.
-#
-# RCS: @(#) $Id: bitmap.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/browse b/library/demos/browse
index ced8385..d107f28 100644
--- a/library/demos/browse
+++ b/library/demos/browse
@@ -6,8 +6,6 @@ exec wish "$0" ${1+"$@"}
# This script generates a directory browser, which lists the working
# directory and allows you to open files or subdirectories by
# double-clicking.
-#
-# RCS: @(#) $Id: browse,v 1.5 2003/09/30 14:54:29 dkf Exp $
package require Tk
diff --git a/library/demos/button.tcl b/library/demos/button.tcl
index 84407f4..bb943e6 100644
--- a/library/demos/button.tcl
+++ b/library/demos/button.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# several button widgets.
-#
-# RCS: @(#) $Id: button.tcl,v 1.9 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/check.tcl b/library/demos/check.tcl
index c9ca56a..c072096 100644
--- a/library/demos/check.tcl
+++ b/library/demos/check.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# several checkbuttons.
-#
-# RCS: @(#) $Id: check.tcl,v 1.7 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/clrpick.tcl b/library/demos/clrpick.tcl
index c20b98f..ba50b75 100644
--- a/library/demos/clrpick.tcl
+++ b/library/demos/clrpick.tcl
@@ -1,8 +1,6 @@
# clrpick.tcl --
#
# This demonstration script prompts the user to select a color.
-#
-# RCS: @(#) $Id: clrpick.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/colors.tcl b/library/demos/colors.tcl
index abd9fb0..99dec92 100644
--- a/library/demos/colors.tcl
+++ b/library/demos/colors.tcl
@@ -3,8 +3,6 @@
# This demonstration script creates a listbox widget that displays
# many of the colors from the X color database. You can click on
# a color to change the application's palette.
-#
-# RCS: @(#) $Id: colors.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl
index 2545d8b..8631904 100644
--- a/library/demos/combo.tcl
+++ b/library/demos/combo.tcl
@@ -1,8 +1,6 @@
# combo.tcl --
#
# This demonstration script creates several combobox widgets.
-#
-# RCS: @(#) $Id: combo.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index 7ad390a..f6e88f4 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a simple canvas that can be
# scrolled in two dimensions.
-#
-# RCS: @(#) $Id: cscroll.tcl,v 1.6 2005/12/13 03:44:34 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl
index 6bfe2be..4b8c644 100644
--- a/library/demos/ctext.tcl
+++ b/library/demos/ctext.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a canvas widget with a text
# item that can be edited and reconfigured in various ways.
-#
-# RCS: @(#) $Id: ctext.tcl,v 1.7 2009/10/27 14:02:17 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/dialog1.tcl b/library/demos/dialog1.tcl
index e76bab3..5c572be 100644
--- a/library/demos/dialog1.tcl
+++ b/library/demos/dialog1.tcl
@@ -1,8 +1,6 @@
# dialog1.tcl --
#
# This demonstration script creates a dialog box with a local grab.
-#
-# RCS: @(#) $Id: dialog1.tcl,v 1.2 1998/09/14 18:23:27 stanton Exp $
after idle {.dialog1.msg configure -wraplength 4i}
set i [tk_dialog .dialog1 "Dialog with local grab" {This is a modal dialog box. It uses Tk's "grab" command to create a "local grab" on the dialog box. The grab prevents any pointer-related events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications.} \
diff --git a/library/demos/dialog2.tcl b/library/demos/dialog2.tcl
index 502ac8b..2f45da8 100644
--- a/library/demos/dialog2.tcl
+++ b/library/demos/dialog2.tcl
@@ -1,8 +1,6 @@
# dialog2.tcl --
#
# This demonstration script creates a dialog box with a global grab.
-#
-# RCS: @(#) $Id: dialog2.tcl,v 1.3 2001/11/05 10:13:53 dkf Exp $
after idle {
.dialog2.msg configure -wraplength 4i
diff --git a/library/demos/entry1.tcl b/library/demos/entry1.tcl
index f7faf69..eef8964 100644
--- a/library/demos/entry1.tcl
+++ b/library/demos/entry1.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates several entry widgets without
# scrollbars.
-#
-# RCS: @(#) $Id: entry1.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/entry2.tcl b/library/demos/entry2.tcl
index 3459591..d0ca35a 100644
--- a/library/demos/entry2.tcl
+++ b/library/demos/entry2.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script is the same as the entry1.tcl script
# except that it creates scrollbars for the entries.
-#
-# RCS: @(#) $Id: entry2.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/entry3.tcl b/library/demos/entry3.tcl
index 2e54b05..d4435c6 100644
--- a/library/demos/entry3.tcl
+++ b/library/demos/entry3.tcl
@@ -3,8 +3,6 @@
# This demonstration script creates several entry widgets whose
# permitted input is constrained in some way. It also shows off a
# password entry.
-#
-# RCS: @(#) $Id: entry3.tcl,v 1.7 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -171,8 +169,8 @@ bind $w.l3.e <FocusIn> {
after idle {%W selection clear}
}
}
-bind $w.l3.e <Left> {phoneSkipLeft %W}
-bind $w.l3.e <Right> {phoneSkipRight %W}
+bind $w.l3.e <<PrevChar>> {phoneSkipLeft %W}
+bind $w.l3.e <<NextChar>> {phoneSkipRight %W}
pack $w.l3.e -fill x -expand 1 -padx 1m -pady 1m
labelframe $w.l4 -text "Password Entry"
diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl
index 445052e..e06ebba 100644
--- a/library/demos/filebox.tcl
+++ b/library/demos/filebox.tcl
@@ -1,8 +1,6 @@
# filebox.tcl --
#
# This demonstration script prompts the user to select a file.
-#
-# RCS: @(#) $Id: filebox.tcl,v 1.11 2010/01/04 12:11:48 patthoyts Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl
index 4302538..827600b 100644
--- a/library/demos/floor.tcl
+++ b/library/demos/floor.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a canvas widet that displays the
# floorplan for DEC's Western Research Laboratory.
-#
-# RCS: @(#) $Id: floor.tcl,v 1.8 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl
index b67e17a..def30c3 100644
--- a/library/demos/fontchoose.tcl
+++ b/library/demos/fontchoose.tcl
@@ -1,8 +1,6 @@
# fontchoose.tcl --
#
# Show off the stock font selector dialog
-#
-# RCS: @(#) $Id: fontchoose.tcl,v 1.2 2010/01/04 12:09:36 patthoyts Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/form.tcl b/library/demos/form.tcl
index 999c7cf..4d80437 100644
--- a/library/demos/form.tcl
+++ b/library/demos/form.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a simple form with a bunch
# of entry widgets.
-#
-# RCS: @(#) $Id: form.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/hello b/library/demos/hello
index 7c47669..d10b8d5 100644
--- a/library/demos/hello
+++ b/library/demos/hello
@@ -5,8 +5,6 @@ exec wish "$0" ${1+"$@"}
# hello --
# Simple Tk script to create a button that prints "Hello, world".
# Click on the button to terminate the program.
-#
-# RCS: @(#) $Id: hello,v 1.5 2009/03/25 23:27:09 nijtmans Exp $
package require Tk
diff --git a/library/demos/hscale.tcl b/library/demos/hscale.tcl
index 1498902..1df144d 100644
--- a/library/demos/hscale.tcl
+++ b/library/demos/hscale.tcl
@@ -1,8 +1,6 @@
# hscale.tcl --
#
# This demonstration script shows an example with a horizontal scale.
-#
-# RCS: @(#) $Id: hscale.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/icon.tcl b/library/demos/icon.tcl
index e8a7ab2..224d8f9 100644
--- a/library/demos/icon.tcl
+++ b/library/demos/icon.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# buttons that display bitmaps instead of text.
-#
-# RCS: @(#) $Id: icon.tcl,v 1.6 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/image1.tcl b/library/demos/image1.tcl
index 95a2c71..0bd2f49 100644
--- a/library/demos/image1.tcl
+++ b/library/demos/image1.tcl
@@ -1,8 +1,6 @@
# image1.tcl --
#
# This demonstration script displays two image widgets.
-#
-# RCS: @(#) $Id: image1.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/image2.tcl b/library/demos/image2.tcl
index eed64ad..a17da31 100644
--- a/library/demos/image2.tcl
+++ b/library/demos/image2.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a simple collection of widgets
# that allow you to select and view images in a Tk label.
-#
-# RCS: @(#) $Id: image2.tcl,v 1.12 2009/02/11 15:25:31 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index c665be2..177e9a4 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a canvas that displays the
# canvas item types.
-#
-# RCS: @(#) $Id: items.tcl,v 1.11 2010/01/04 22:13:59 patthoyts Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -175,7 +173,7 @@ bind $c <2> "$c scan mark %x %y"
bind $c <B2-Motion> "$c scan dragto %x %y"
bind $c <3> "itemMark $c %x %y"
bind $c <B3-Motion> "itemStroke $c %x %y"
-bind $c <Control-f> "itemsUnderArea $c"
+bind $c <<NextChar>> "itemsUnderArea $c"
bind $c <1> "itemStartDrag $c %x %y"
bind $c <B1-Motion> "itemDrag $c %x %y"
diff --git a/library/demos/ixset b/library/demos/ixset
index 21a099f..06b644d 100644
--- a/library/demos/ixset
+++ b/library/demos/ixset
@@ -8,8 +8,6 @@ exec wish "$0" ${1+"$@"}
# History :
# 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design
# 92/08/01 : pda@masi.ibp.fr : cleaning
-#
-# RCS: @(#) $Id: ixset,v 1.5 2003/09/30 14:54:30 dkf Exp $
package require Tcl 8.4
package require Tk
diff --git a/library/demos/label.tcl b/library/demos/label.tcl
index 9b35f4b..13463f7 100644
--- a/library/demos/label.tcl
+++ b/library/demos/label.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# several label widgets.
-#
-# RCS: @(#) $Id: label.tcl,v 1.8 2009/09/04 10:03:44 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/labelframe.tcl b/library/demos/labelframe.tcl
index 65411b1..21d079f 100644
--- a/library/demos/labelframe.tcl
+++ b/library/demos/labelframe.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# several labelframe widgets.
-#
-# RCS: @(#) $Id: labelframe.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/mclist.tcl b/library/demos/mclist.tcl
index ba21c01..7a4dd4c 100644
--- a/library/demos/mclist.tcl
+++ b/library/demos/mclist.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing a Ttk
# tree widget configured as a multi-column listbox.
-#
-# RCS: @(#) $Id: mclist.tcl,v 1.6 2009/07/15 21:50:52 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index d1b7c1c..e19df57 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a window with a bunch of menus
# and cascaded menus using menubars.
-#
-# RCS: @(#) $Id: menu.tcl,v 1.11 2007/04/23 21:16:00 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -58,7 +56,7 @@ menu $m -tearoff 0
$m add command -label "Long entry that does nothing"
if {[tk windowingsystem] eq "aqua"} {
set modifier Command
-} elseif {$tcl_platform(platform) == "windows"} {
+} elseif {[tk windowingsystem] == "win32"} {
set modifier Control
} else {
set modifier Meta
diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl
index cec3284..86326b5 100644
--- a/library/demos/menubu.tcl
+++ b/library/demos/menubu.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a window with a bunch of menus
# and cascaded menus using menubuttons.
-#
-# # RCS: @(#) $Id: menubu.tcl,v 1.6 2007/04/23 21:16:01 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl
index 1e09cb5..bd98bf2 100644
--- a/library/demos/msgbox.tcl
+++ b/library/demos/msgbox.tcl
@@ -1,8 +1,6 @@
# msgbox.tcl --
#
# This demonstration script creates message boxes of various type
-#
-# RCS: @(#) $Id: msgbox.tcl,v 1.7 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/paned1.tcl b/library/demos/paned1.tcl
index 1c9e3e6..783b7f3 100644
--- a/library/demos/paned1.tcl
+++ b/library/demos/paned1.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# a paned window that separates two windows horizontally.
-#
-# RCS: @(#) $Id: paned1.tcl,v 1.3 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/paned2.tcl b/library/demos/paned2.tcl
index 9e72139..f481d14 100644
--- a/library/demos/paned2.tcl
+++ b/library/demos/paned2.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# a paned window that separates two windows vertically.
-#
-# RCS: @(#) $Id: paned2.tcl,v 1.3 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl
index e920c5d..d344d8d 100644
--- a/library/demos/pendulum.tcl
+++ b/library/demos/pendulum.tcl
@@ -2,8 +2,6 @@
#
# This demonstration illustrates how Tcl/Tk can be used to construct
# simulations of physical systems.
-#
-# RCS: @(#) $Id: pendulum.tcl,v 1.5 2009/08/08 08:23:40 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/plot.tcl b/library/demos/plot.tcl
index 82a2c60..e7f0361 100644
--- a/library/demos/plot.tcl
+++ b/library/demos/plot.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a canvas widget showing a 2-D
# plot with data points that can be dragged with the mouse.
-#
-# RCS: @(#) $Id: plot.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl
index 485f69c..fb8ab4c 100644
--- a/library/demos/puzzle.tcl
+++ b/library/demos/puzzle.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a 15-puzzle game using a collection
# of buttons.
-#
-# RCS: @(#) $Id: puzzle.tcl,v 1.7 2007/04/23 21:16:01 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/radio.tcl b/library/demos/radio.tcl
index 28ea236..5c73703 100644
--- a/library/demos/radio.tcl
+++ b/library/demos/radio.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing
# several radiobutton widgets.
-#
-# RCS: @(#) $Id: radio.tcl,v 1.8 2007/04/23 21:16:01 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/rmt b/library/demos/rmt
index 13b7ac9..51886de 100644
--- a/library/demos/rmt
+++ b/library/demos/rmt
@@ -6,8 +6,6 @@ exec wish "$0" ${1+"$@"}
# This script implements a simple remote-control mechanism for
# Tk applications. It allows you to select an application and
# then type commands to that application.
-#
-# RCS: @(#) $Id: rmt,v 1.7 2009/03/25 23:27:14 nijtmans Exp $
package require Tcl 8.4
package require Tk
diff --git a/library/demos/rolodex b/library/demos/rolodex
index 30946aa..8941570 100644
--- a/library/demos/rolodex
+++ b/library/demos/rolodex
@@ -7,8 +7,6 @@ exec wish "$0" ${1+"$@"}
# benchmark. It creates something that has some of the look and
# feel of a rolodex program, although it's lifeless and doesn't
# actually do the rolodex application.
-#
-# RCS: @(#) $Id: rolodex,v 1.5 2003/09/30 14:54:30 dkf Exp $
package require Tk
diff --git a/library/demos/ruler.tcl b/library/demos/ruler.tcl
index 45881cd..557b680 100644
--- a/library/demos/ruler.tcl
+++ b/library/demos/ruler.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a canvas widget that displays a ruler
# with tab stops that can be set, moved, and deleted.
-#
-# RCS: @(#) $Id: ruler.tcl,v 1.7 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/sayings.tcl b/library/demos/sayings.tcl
index 091133e..4d26ffe 100644
--- a/library/demos/sayings.tcl
+++ b/library/demos/sayings.tcl
@@ -3,8 +3,6 @@
# This demonstration script creates a listbox that can be scrolled
# both horizontally and vertically. It displays a collection of
# well-known sayings.
-#
-# RCS: @(#) $Id: sayings.tcl,v 1.6 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/search.tcl b/library/demos/search.tcl
index 3a792c4..9f44e16 100644
--- a/library/demos/search.tcl
+++ b/library/demos/search.tcl
@@ -3,8 +3,6 @@
# This demonstration script creates a collection of widgets that
# allow you to load a file into a text widget, then perform searches
# on that file.
-#
-# RCS: @(#) $Id: search.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/spin.tcl b/library/demos/spin.tcl
index 512515d..d897e6d 100644
--- a/library/demos/spin.tcl
+++ b/library/demos/spin.tcl
@@ -1,8 +1,6 @@
# spin.tcl --
#
# This demonstration script creates several spinbox widgets.
-#
-# RCS: @(#) $Id: spin.tcl,v 1.3 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/square b/library/demos/square
index 8bcb5a7..08c362b 100644
--- a/library/demos/square
+++ b/library/demos/square
@@ -10,8 +10,6 @@ exec wish "$0" ${1+"$@"}
#
# Button-1 press/drag: moves square to mouse
# "a": toggle size animation on/off
-#
-# RCS: @(#) $Id: square,v 1.4 2009/03/25 23:27:13 nijtmans Exp $
package require Tk ;# We use Tk generally, and...
package require Tktest ;# ... we use the square widget too.
diff --git a/library/demos/states.tcl b/library/demos/states.tcl
index 443fea5..e76540d 100644
--- a/library/demos/states.tcl
+++ b/library/demos/states.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a listbox widget that displays
# the names of the 50 states in the United States of America.
-#
-# RCS: @(#) $Id: states.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/style.tcl b/library/demos/style.tcl
index e62d118..614ea1f 100644
--- a/library/demos/style.tcl
+++ b/library/demos/style.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a text widget that illustrates the
# various display styles that may be set for tags.
-#
-# RCS: @(#) $Id: style.tcl,v 1.6 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/tcolor b/library/demos/tcolor
index c92de1c..6e50c61 100644
--- a/library/demos/tcolor
+++ b/library/demos/tcolor
@@ -6,8 +6,6 @@ exec wish "$0" ${1+"$@"}
# This script implements a simple color editor, where you can
# create colors using either the RGB, HSB, or CYM color spaces
# and apply the color to existing applications.
-#
-# RCS: @(#) $Id: tcolor,v 1.7 2009/03/25 23:27:14 nijtmans Exp $
package require Tk 8.4
wm title . "Color Editor"
diff --git a/library/demos/text.tcl b/library/demos/text.tcl
index 5b8341d..785e9e6 100644
--- a/library/demos/text.tcl
+++ b/library/demos/text.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a text widget that describes
# the basic editing functions.
-#
-# RCS: @(#) $Id: text.tcl,v 1.9 2008/12/10 05:02:51 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -94,11 +92,11 @@ cursor. Control-t transposes the two characters on either side of the
insertion cursor. Control-z undoes the last editing action performed,
and }
-switch $tcl_platform(platform) {
- "unix" {
+switch [tk windowingsystem] {
+ "aqua" - "x11" {
$w.text insert end "Control-Shift-z"
}
- "windows" {
+ "win32" {
$w.text insert end "Control-y"
}
}
diff --git a/library/demos/textpeer.tcl b/library/demos/textpeer.tcl
index a93f127..e94284e 100644
--- a/library/demos/textpeer.tcl
+++ b/library/demos/textpeer.tcl
@@ -3,8 +3,6 @@
# This demonstration script creates a pair of text widgets that can edit a
# single logical buffer. This is particularly useful when editing related text
# in two (or more) parts of the same file.
-#
-# RCS: @(#) $Id: textpeer.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/timer b/library/demos/timer
index b4ed74a..e10b840 100644
--- a/library/demos/timer
+++ b/library/demos/timer
@@ -4,8 +4,6 @@ exec wish "$0" ${1+"$@"}
# timer --
# This script generates a counter with start and stop buttons.
-#
-# RCS: @(#) $Id: timer,v 1.5 2009/03/25 23:27:12 nijtmans Exp $
package require Tcl 8.4
package require Tk
diff --git a/library/demos/toolbar.tcl b/library/demos/toolbar.tcl
index 81724eb..0ae4669 100644
--- a/library/demos/toolbar.tcl
+++ b/library/demos/toolbar.tcl
@@ -1,8 +1,6 @@
# toolbar.tcl --
#
# This demonstration script creates a toolbar that can be torn off.
-#
-# RCS: @(#) $Id: toolbar.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -17,57 +15,46 @@ wm title $w "Toolbar Demonstration"
wm iconname $w "toolbar"
positionWindow $w
-if {[tk windowingsystem] ne "aqua"} {
- ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
- a toolbar that is styled correctly and which can be torn off. The\
- buttons are configured to be \u201Ctoolbar style\u201D buttons by\
- telling them that they are to use the Toolbutton style. At the left\
- end of the toolbar is a simple marker that the cursor changes to a\
- movement icon over; drag that away from the toolbar to tear off the\
- whole toolbar into a separate toplevel widget. When the dragged-off\
- toolbar is no longer needed, just close it like any normal toplevel\
- and it will reattach to the window it was torn off from."
-} else {
ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
- a toolbar that is styled correctly. The buttons are configured to\
- be \u201Ctoolbar style\u201D buttons by telling them that they are\
- to use the Toolbutton style."
-}
+ a toolbar that is styled correctly and which can be torn off. The\
+ buttons are configured to be \u201Ctoolbar style\u201D buttons by\
+ telling them that they are to use the Toolbutton style. At the left\
+ end of the toolbar is a simple marker that the cursor changes to a\
+ movement icon over; drag that away from the toolbar to tear off the\
+ whole toolbar into a separate toplevel widget. When the dragged-off\
+ toolbar is no longer needed, just close it like any normal toplevel\
+ and it will reattach to the window it was torn off from."
## Set up the toolbar hull
set t [frame $w.toolbar] ;# Must be a frame!
ttk::separator $w.sep
ttk::frame $t.tearoff -cursor fleur
-if {[tk windowingsystem] ne "aqua"} {
- ttk::separator $t.tearoff.to -orient vertical
- ttk::separator $t.tearoff.to2 -orient vertical
- pack $t.tearoff.to -fill y -expand 1 -padx 2 -side left
- pack $t.tearoff.to2 -fill y -expand 1 -side left
-}
+ttk::separator $t.tearoff.to -orient vertical
+ttk::separator $t.tearoff.to2 -orient vertical
+pack $t.tearoff.to -fill y -expand 1 -padx 2 -side left
+pack $t.tearoff.to2 -fill y -expand 1 -side left
ttk::frame $t.contents
grid $t.tearoff $t.contents -sticky nsew
grid columnconfigure $t $t.contents -weight 1
grid columnconfigure $t.contents 1000 -weight 1
-if {[tk windowingsystem] ne "aqua"} {
- ## Bindings so that the toolbar can be torn off and reattached
- bind $t.tearoff <B1-Motion> [list tearoff $t %X %Y]
- bind $t.tearoff.to <B1-Motion> [list tearoff $t %X %Y]
- bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y]
- proc tearoff {w x y} {
- if {[string match $w* [winfo containing $x $y]]} {
- return
- }
- grid remove $w
- grid remove $w.tearoff
- wm manage $w
- wm protocol $w WM_DELETE_WINDOW [list untearoff $w]
- }
- proc untearoff {w} {
- wm forget $w
- grid $w.tearoff
- grid $w
+## Bindings so that the toolbar can be torn off and reattached
+bind $t.tearoff <B1-Motion> [list tearoff $t %X %Y]
+bind $t.tearoff.to <B1-Motion> [list tearoff $t %X %Y]
+bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y]
+proc tearoff {w x y} {
+ if {[string match $w* [winfo containing $x $y]]} {
+ return
}
+ grid remove $w
+ grid remove $w.tearoff
+ wm manage $w
+ wm protocol $w WM_DELETE_WINDOW [list untearoff $w]
+}
+proc untearoff {w} {
+ wm forget $w
+ grid $w.tearoff
+ grid $w
}
## Toolbar contents
diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl
index 828560d..71c32c1 100644
--- a/library/demos/tree.tcl
+++ b/library/demos/tree.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing a Ttk
# tree widget.
-#
-# RCS: @(#) $Id: tree.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ttkbut.tcl b/library/demos/ttkbut.tcl
index 5235cdc..904cd31 100644
--- a/library/demos/ttkbut.tcl
+++ b/library/demos/ttkbut.tcl
@@ -3,8 +3,6 @@
# This demonstration script creates a toplevel window containing several
# simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and
# radiobuttons.
-#
-# RCS: @(#) $Id: ttkbut.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ttkmenu.tcl b/library/demos/ttkmenu.tcl
index 59a9452..0084dd6 100644
--- a/library/demos/ttkmenu.tcl
+++ b/library/demos/ttkmenu.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing several Ttk
# menubutton widgets.
-#
-# RCS: @(#) $Id: ttkmenu.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ttknote.tcl b/library/demos/ttknote.tcl
index 5a4e728..50a9258 100644
--- a/library/demos/ttknote.tcl
+++ b/library/demos/ttknote.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a toplevel window containing a Ttk
# notebook widget.
-#
-# RCS: @(#) $Id: ttknote.tcl,v 1.6 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl
index 9664ad2..7575d76 100644
--- a/library/demos/ttkpane.tcl
+++ b/library/demos/ttkpane.tcl
@@ -1,8 +1,6 @@
# ttkpane.tcl --
#
# This demonstration script creates a Ttk pane with some content.
-#
-# RCS: @(#) $Id: ttkpane.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ttkprogress.tcl b/library/demos/ttkprogress.tcl
index 98388b5..8a72cf9 100644
--- a/library/demos/ttkprogress.tcl
+++ b/library/demos/ttkprogress.tcl
@@ -1,8 +1,6 @@
# ttkprogress.tcl --
#
# This demonstration script creates several progress bar widgets.
-#
-# RCS: @(#) $Id: ttkprogress.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/ttkscale.tcl b/library/demos/ttkscale.tcl
index dbd09a3..1a95416 100644
--- a/library/demos/ttkscale.tcl
+++ b/library/demos/ttkscale.tcl
@@ -1,8 +1,6 @@
# ttkscale.tcl --
#
# This demonstration script shows an example with a horizontal scale.
-#
-# RCS: @(#) $Id: ttkscale.tcl,v 1.3 2009/12/16 13:20:18 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl
index 062fc61..8f3c12e 100644
--- a/library/demos/twind.tcl
+++ b/library/demos/twind.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script creates a text widget with a bunch of
# embedded windows.
-#
-# RCS: @(#) $Id: twind.tcl,v 1.12 2009/02/11 15:17:26 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/unicodeout.tcl b/library/demos/unicodeout.tcl
index 46bbfd2..faa9f90 100644
--- a/library/demos/unicodeout.tcl
+++ b/library/demos/unicodeout.tcl
@@ -2,8 +2,6 @@
#
# This demonstration script shows how you can produce output (in label
# widgets) using many different alphabets.
-#
-# RCS: @(#) $Id: unicodeout.tcl,v 1.9 2009/12/15 11:50:33 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/vscale.tcl b/library/demos/vscale.tcl
index 599329c..2c7ea76 100644
--- a/library/demos/vscale.tcl
+++ b/library/demos/vscale.tcl
@@ -1,8 +1,6 @@
# vscale.tcl --
#
# This demonstration script shows an example with a vertical scale.
-#
-# RCS: @(#) $Id: vscale.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
diff --git a/library/demos/widget b/library/demos/widget
index 8a8d799..8b92f9a 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -9,8 +9,6 @@ exec wish "$0" ${1+"$@"}
# demonstrations. The code for the actual demonstrations is contained in
# separate ".tcl" files is this directory, which are sourced by this script as
# needed.
-#
-# RCS: @(#) $Id: widget,v 1.60 2010/11/05 07:49:34 nijtmans Exp $
package require Tcl 8.5
package require Tk 8.5
diff --git a/library/dialog.tcl b/library/dialog.tcl
index 162ecbe..adea259 100644
--- a/library/dialog.tcl
+++ b/library/dialog.tcl
@@ -3,8 +3,6 @@
# This file defines the procedure tk_dialog, which creates a dialog
# box containing a bitmap, a message, and one or more buttons.
#
-# RCS: @(#) $Id: dialog.tcl,v 1.26 2010/01/19 01:27:41 patthoyts Exp $
-#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
#
@@ -148,27 +146,9 @@ proc ::tk_dialog {w title text bitmap default args} {
# 6. Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
- # display and de-iconify it.
-
- wm withdraw $w
- update idletasks
- set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \
- - [winfo vrootx [winfo parent $w]]}]
- set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \
- - [winfo vrooty [winfo parent $w]]}]
- # Make sure that the window is on the screen and set the maximum
- # size of the window is the size of the screen. That'll let things
- # fail fairly gracefully when very large messages are used. [Bug 827535]
- if {$x < 0} {
- set x 0
- }
- if {$y < 0} {
- set y 0
- }
- wm maxsize $w [winfo screenwidth $w] [winfo screenheight $w]
- wm geometry $w +$x+$y
- wm deiconify $w
+ # display (Motif style) and de-iconify it.
+ ::tk::PlaceWindow $w
tkwait visibility $w
# 7. Set a grab and claim the focus too.
diff --git a/library/entry.tcl b/library/entry.tcl
index 74e70ad..f28547e 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -3,8 +3,6 @@
# This file defines the default bindings for Tk entry widgets and provides
# procedures that help in implementing those bindings.
#
-# RCS: @(#) $Id: entry.tcl,v 1.28 2010/03/17 09:27:23 dkf Exp $
-#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
#
@@ -187,10 +185,10 @@ bind Entry <Control-Shift-space> {
bind Entry <Shift-Select> {
%W selection adjust insert
}
-bind Entry <Control-slash> {
+bind Entry <<SelectAll>> {
%W selection range 0 end
}
-bind Entry <Control-backslash> {
+bind Entry <<SelectNone>> {
%W selection clear
}
bind Entry <KeyPress> {
@@ -216,12 +214,12 @@ if {[tk windowingsystem] eq "aqua"} {
bind Entry <Command-KeyPress> {# nothing}
}
# Tk-on-Cocoa generates characters for these two keys. [Bug 2971663]
-bind Entry <Down> {# nothing}
-bind Entry <Up> {# nothing}
+bind Entry <<NextLine>> {# nothing}
+bind Entry <<PrevLine>> {# nothing}
# On Windows, paste is done using Shift-Insert. Shift-Insert already
# generates the <<Paste>> event, so we don't need to do anything here.
-if {$tcl_platform(platform) ne "windows"} {
+if {[tk windowingsystem] ne "win32"} {
bind Entry <Insert> {
catch {tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]}
}
@@ -229,31 +227,11 @@ if {$tcl_platform(platform) ne "windows"} {
# Additional emacs-like bindings:
-bind Entry <Control-a> {
- if {!$tk_strictMotif} {
- tk::EntrySetCursor %W 0
- }
-}
-bind Entry <Control-b> {
- if {!$tk_strictMotif} {
- tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
- }
-}
bind Entry <Control-d> {
if {!$tk_strictMotif} {
%W delete insert
}
}
-bind Entry <Control-e> {
- if {!$tk_strictMotif} {
- tk::EntrySetCursor %W end
- }
-}
-bind Entry <Control-f> {
- if {!$tk_strictMotif} {
- tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
- }
-}
bind Entry <Control-h> {
if {!$tk_strictMotif} {
tk::EntryBackspace %W
@@ -581,7 +559,7 @@ proc ::tk::EntryTranspose w {
# w - The entry window in which the cursor is to move.
# start - Position at which to start search.
-if {$tcl_platform(platform) eq "windows"} {
+if {[tk windowingsystem] eq "win32"} {
proc ::tk::EntryNextWord {w start} {
set pos [tcl_endOfWord [$w get] [$w index $start]]
if {$pos >= 0} {
diff --git a/library/focus.tcl b/library/focus.tcl
index 609a803..640406e 100644
--- a/library/focus.tcl
+++ b/library/focus.tcl
@@ -3,8 +3,6 @@
# This file defines several procedures for managing the input
# focus.
#
-# RCS: @(#) $Id: focus.tcl,v 1.11 2006/01/25 18:22:04 dgp Exp $
-#
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl
index 45cb402..13b5895 100644
--- a/library/fontchooser.tcl
+++ b/library/fontchooser.tcl
@@ -7,8 +7,6 @@
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# RCS: @(#) $Id: fontchooser.tcl,v 1.3 2010/01/04 20:01:06 patthoyts Exp $
namespace eval ::tk::fontchooser {
variable S
diff --git a/library/iconlist.tcl b/library/iconlist.tcl
index 2503181..ce1aae2 100644
--- a/library/iconlist.tcl
+++ b/library/iconlist.tcl
@@ -3,8 +3,6 @@
# Implements the icon-list megawidget used in the "Tk" standard file
# selection dialog boxes.
#
-# RCS: @(#) $Id: iconlist.tcl,v 1.4 2010/03/12 13:53:43 dkf Exp $
-#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
# Copyright (c) 2009 Donal K. Fellows
#
@@ -446,10 +444,10 @@ package require Tk 8.6
bind $canvas <Control-B1-Motion> {;}
bind $canvas <Shift-B1-Motion> [namespace code {my ShiftMotion1 %x %y}]
- bind $canvas <Up> [namespace code {my UpDown -1}]
- bind $canvas <Down> [namespace code {my UpDown 1}]
- bind $canvas <Left> [namespace code {my LeftRight -1}]
- bind $canvas <Right> [namespace code {my LeftRight 1}]
+ bind $canvas <<PrevLine>> [namespace code {my UpDown -1}]
+ bind $canvas <<NextLine>> [namespace code {my UpDown 1}]
+ bind $canvas <<PrevChar>> [namespace code {my LeftRight -1}]
+ bind $canvas <<NextChar>> [namespace code {my LeftRight 1}]
bind $canvas <Return> [namespace code {my ReturnKey}]
bind $canvas <KeyPress> [namespace code {my KeyPress %A}]
bind $canvas <Control-KeyPress> ";"
diff --git a/library/icons.tcl b/library/icons.tcl
index 452ae50..e53a1bd 100644
--- a/library/icons.tcl
+++ b/library/icons.tcl
@@ -9,9 +9,6 @@
# See http://tango.freedesktop.org/Tango_Desktop_Project
#
# Copyright (c) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
-#
-# RCS: @(#) $Id: icons.tcl,v 1.1 2009/01/11 11:51:39 patthoyts Exp $
-#
namespace eval ::tk::icons {}
diff --git a/library/images/README b/library/images/README
index 0fa13f0..7b61d5a 100644
--- a/library/images/README
+++ b/library/images/README
@@ -1,12 +1,7 @@
README - images directory
-RCS: @(#) $Id: README,v 1.2 1998/09/14 18:23:32 stanton Exp $
-
-
This directory includes images for the Tcl Logo and the Tcl Powered
Logo. Please feel free to use the Tcl Powered Logo on any of your
products that employ the use of Tcl or Tk. The Tcl logo may also be
used to promote Tcl in your product documentation, web site or other
places you so desire.
-
-
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 80310a5..01fb03d 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -3,8 +3,6 @@
# This file defines the default bindings for Tk listbox widgets
# and provides procedures that help in implementing those bindings.
#
-# RCS: @(#) $Id: listbox.tcl,v 1.19 2008/12/28 23:43:14 dkf Exp $
-#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
# Copyright (c) 1998 by Scriptics Corporation.
@@ -71,28 +69,28 @@ bind Listbox <B1-Enter> {
tk::CancelRepeat
}
-bind Listbox <Up> {
+bind Listbox <<PrevLine>> {
tk::ListboxUpDown %W -1
}
-bind Listbox <Shift-Up> {
+bind Listbox <<SelectPrevLine>> {
tk::ListboxExtendUpDown %W -1
}
-bind Listbox <Down> {
+bind Listbox <<NextLine>> {
tk::ListboxUpDown %W 1
}
-bind Listbox <Shift-Down> {
+bind Listbox <<SelectNextLine>> {
tk::ListboxExtendUpDown %W 1
}
-bind Listbox <Left> {
+bind Listbox <<PrevChar>> {
%W xview scroll -1 units
}
-bind Listbox <Control-Left> {
+bind Listbox <<PrevWord>> {
%W xview scroll -1 pages
}
-bind Listbox <Right> {
+bind Listbox <<NextChar>> {
%W xview scroll 1 units
}
-bind Listbox <Control-Right> {
+bind Listbox <<NextWord>> {
%W xview scroll 1 pages
}
bind Listbox <Prior> {
@@ -109,10 +107,10 @@ bind Listbox <Control-Prior> {
bind Listbox <Control-Next> {
%W xview scroll 1 pages
}
-bind Listbox <Home> {
+bind Listbox <<LineStart>> {
%W xview moveto 0
}
-bind Listbox <End> {
+bind Listbox <<LineEnd>> {
%W xview moveto 1
}
bind Listbox <Control-Home> {
@@ -122,7 +120,7 @@ bind Listbox <Control-Home> {
%W selection set 0
event generate %W <<ListboxSelect>>
}
-bind Listbox <Shift-Control-Home> {
+bind Listbox <Control-Shift-Home> {
tk::ListboxDataExtend %W 0
}
bind Listbox <Control-End> {
@@ -132,7 +130,7 @@ bind Listbox <Control-End> {
%W selection set end
event generate %W <<ListboxSelect>>
}
-bind Listbox <Shift-Control-End> {
+bind Listbox <Control-Shift-End> {
tk::ListboxDataExtend %W [%W index end]
}
bind Listbox <<Copy>> {
@@ -156,10 +154,10 @@ bind Listbox <Shift-Select> {
bind Listbox <Escape> {
tk::ListboxCancel %W
}
-bind Listbox <Control-slash> {
+bind Listbox <<SelectAll>> {
tk::ListboxSelectAll %W
}
-bind Listbox <Control-backslash> {
+bind Listbox <<SelectNone>> {
if {[%W cget -selectmode] ne "browse"} {
%W selection clear 0 end
event generate %W <<ListboxSelect>>
diff --git a/library/megawidget.tcl b/library/megawidget.tcl
index 40033ea..1cd2900 100644
--- a/library/megawidget.tcl
+++ b/library/megawidget.tcl
@@ -4,8 +4,6 @@
# the ::tk::IconList megawdget, which is itself only designed for use in
# the Unix file dialogs.
#
-# CVS: @(#) $Id: megawidget.tcl,v 1.1 2010/03/12 13:53:43 dkf Exp $
-#
# Copyright (c) 2009-2010 Donal K. Fellows
#
# See the file "license.terms" for information on usage and redistribution of
diff --git a/library/menu.tcl b/library/menu.tcl
index e9d1c27..a51c96f 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -4,8 +4,6 @@
# It also implements keyboard traversal of menus and implements a few
# other utility procedures related to menus.
#
-# RCS: @(#) $Id: menu.tcl,v 1.34 2010/03/06 01:11:07 patthoyts Exp $
-#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
@@ -62,7 +60,7 @@
# This file is tricky because there are five different ways that menus
# can be used:
#
-# 1. As a pulldown from a menubutton. In this style, the variable
+# 1. As a pulldown from a menubutton. In this style, the variable
# tk::Priv(postedMb) identifies the posted menubutton.
# 2. As a torn-off menu copied from some other menu. In this style
# tk::Priv(postedMb) is empty, and menu's type is "tearoff".
@@ -151,16 +149,16 @@ bind Menu <Return> {
bind Menu <Escape> {
tk::MenuEscape %W
}
-bind Menu <Left> {
+bind Menu <<PrevChar>> {
tk::MenuLeftArrow %W
}
-bind Menu <Right> {
+bind Menu <<NextChar>> {
tk::MenuRightArrow %W
}
-bind Menu <Up> {
+bind Menu <<PrevLine>> {
tk::MenuUpArrow %W
}
-bind Menu <Down> {
+bind Menu <<NextLine>> {
tk::MenuDownArrow %W
}
bind Menu <KeyPress> {
@@ -284,81 +282,81 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
update idletasks
if {[catch {
switch [$w cget -direction] {
- above {
- set x [winfo rootx $w]
- set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}]
+ above {
+ set x [winfo rootx $w]
+ set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}]
# if we go offscreen to the top, show as 'below'
- if {$y < 0} {
- set y [expr {[winfo rooty $w] + [winfo height $w]}]
+ if {$y < [winfo vrooty $w]} {
+ set y [expr {[winfo vrooty $w] + [winfo rooty $w] + [winfo reqheight $w]}]
}
PostOverPoint $menu $x $y
- }
- below {
- set x [winfo rootx $w]
- set y [expr {[winfo rooty $w] + [winfo height $w]}]
+ }
+ below {
+ set x [winfo rootx $w]
+ set y [expr {[winfo rooty $w] + [winfo height $w]}]
# if we go offscreen to the bottom, show as 'above'
set mh [winfo reqheight $menu]
- if {($y + $mh) > [winfo screenheight $w]} {
- set y [expr {[winfo rooty $w] - $mh}]
+ if {($y + $mh) > ([winfo vrooty $w] + [winfo vrootheight $w])} {
+ set y [expr {[winfo vrooty $w] + [winfo vrootheight $w] + [winfo rooty $w] - $mh}]
}
PostOverPoint $menu $x $y
- }
- left {
- set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}]
- set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
- set entry [MenuFindName $menu [$w cget -text]]
- if {[$w cget -indicatoron] && $entry ne ""} {
+ }
+ left {
+ set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}]
+ set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
+ set entry [MenuFindName $menu [$w cget -text]]
+ if {[$w cget -indicatoron]} {
if {$entry == [$menu index last]} {
- incr y [expr {-([$menu yposition $entry] \
- + [winfo reqheight $menu])/2}]
+ incr y [expr {-([$menu yposition $entry] \
+ + [winfo reqheight $menu])/2}]
} else {
- incr y [expr {-([$menu yposition $entry] \
+ incr y [expr {-([$menu yposition $entry] \
+ [$menu yposition [expr {$entry+1}]])/2}]
}
- }
+ }
PostOverPoint $menu $x $y
if {$entry ne "" \
&& [$menu entrycget $entry -state] ne "disabled"} {
- $menu activate $entry
+ $menu activate $entry
GenerateMenuSelect $menu
- }
- }
- right {
- set x [expr {[winfo rootx $w] + [winfo width $w]}]
- set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
- set entry [MenuFindName $menu [$w cget -text]]
- if {[$w cget -indicatoron] && $entry ne ""} {
+ }
+ }
+ right {
+ set x [expr {[winfo rootx $w] + [winfo width $w]}]
+ set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
+ set entry [MenuFindName $menu [$w cget -text]]
+ if {[$w cget -indicatoron]} {
if {$entry == [$menu index last]} {
- incr y [expr {-([$menu yposition $entry] \
- + [winfo reqheight $menu])/2}]
+ incr y [expr {-([$menu yposition $entry] \
+ + [winfo reqheight $menu])/2}]
} else {
- incr y [expr {-([$menu yposition $entry] \
+ incr y [expr {-([$menu yposition $entry] \
+ [$menu yposition [expr {$entry+1}]])/2}]
}
- }
+ }
PostOverPoint $menu $x $y
if {$entry ne "" \
&& [$menu entrycget $entry -state] ne "disabled"} {
- $menu activate $entry
+ $menu activate $entry
GenerateMenuSelect $menu
- }
- }
- default {
- if {[$w cget -indicatoron]} {
+ }
+ }
+ default {
+ if {[$w cget -indicatoron]} {
if {$y eq ""} {
set x [expr {[winfo rootx $w] + [winfo width $w]/2}]
set y [expr {[winfo rooty $w] + [winfo height $w]/2}]
- }
+ }
PostOverPoint $menu $x $y [MenuFindName $menu [$w cget -text]]
} else {
PostOverPoint $menu [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}]
- }
- }
+ }
+ }
}
} msg]} {
# Error posting menu (e.g. bogus -postcommand). Unpost it and
# reflect the error.
-
+
set savedInfo $errorInfo
MenuUnpost {}
error $msg $savedInfo
@@ -367,7 +365,7 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
set Priv(tearoff) $tearoff
if {$tearoff != 0} {
- focus $menu
+ focus $menu
if {[winfo viewable $w]} {
SaveGrabInfo $w
grab -global $w
@@ -427,8 +425,7 @@ proc ::tk::MenuUnpost menu {
} elseif {$Priv(popup) ne ""} {
$Priv(popup) unpost
set Priv(popup) {}
- } elseif {[$menu cget -type] ne "menubar" \
- && [$menu cget -type] ne "tearoff"} {
+ } elseif {[$menu cget -type] ne "menubar" && [$menu cget -type] ne "tearoff"} {
# We're in a cascaded sub-menu from a torn-off menu or popup.
# Unpost all the menus up to the toplevel one (but not
# including the top-level torn-off one) and deactivate the
@@ -436,8 +433,7 @@ proc ::tk::MenuUnpost menu {
while {1} {
set parent [winfo parent $menu]
- if {[winfo class $parent] ne "Menu" \
- || ![winfo ismapped $parent]} {
+ if {[winfo class $parent] ne "Menu" || ![winfo ismapped $parent]} {
break
}
$parent activate none
@@ -456,8 +452,8 @@ proc ::tk::MenuUnpost menu {
}
if {($Priv(tearoff) != 0) || $Priv(menuBar) ne ""} {
- # Release grab, if any, and restore the previous grab, if there
- # was one.
+ # Release grab, if any, and restore the previous grab, if there
+ # was one.
if {$menu ne ""} {
set grab [grab current $menu]
if {$grab ne ""} {
@@ -567,15 +563,14 @@ proc ::tk::MenuMotion {menu x y state} {
&& $index ne "none" \
&& $index ne $activeindex} {
set mode [option get $menu clickToFocus ClickToFocus]
- if {$mode eq "" || ([string is boolean $mode] && !$mode)} {
+ if {[string is false $mode]} {
set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}]
- if {[$menu type $activeindex] eq "cascade"} {
- set Priv(menuDeactivatedTimer) \
- [after $delay [list $menu postcascade none]]
- }
if {[$menu type $index] eq "cascade"} {
set Priv(menuActivatedTimer) \
[after $delay [list $menu postcascade active]]
+ } else {
+ set Priv(menuDeactivatedTimer) \
+ [after $delay [list $menu postcascade none]]
}
}
}
@@ -705,7 +700,7 @@ proc ::tk::MenuInvoke {w buttonRelease} {
set isCascade [string equal [$w type $active] "cascade"]
# Only de-activate the active item if it's a cascade; this prevents
- # the annoying "activation flicker" you otherwise get with
+ # the annoying "activation flicker" you otherwise get with
# checkbuttons/commands/etc. on menubars
if { $isCascade } {
@@ -1033,11 +1028,10 @@ proc ::tk::TraverseToMenu {w char} {
return
}
while {[winfo class $w] eq "Menu"} {
- if {[$w cget -type] ne "menubar" && $Priv(postedMb) eq ""} {
- return
- }
if {[$w cget -type] eq "menubar"} {
break
+ } elseif {$Priv(postedMb) eq ""} {
+ return
}
set w [winfo parent $w]
}
@@ -1156,8 +1150,7 @@ proc ::tk::MenuFirstEntry menu {
# otherwise, if the first entry of the cascade is a cascade,
# we can get an annoying cascading effect resulting in a bunch of
# menus getting posted (bug 676)
- if {[$menu type $i] eq "cascade" \
- && [$menu cget -type] eq "menubar"} {
+ if {[$menu type $i] eq "cascade" && [$menu cget -type] eq "menubar"} {
set cascade [$menu entrycget $i -menu]
if {$cascade ne ""} {
$menu postcascade $i
@@ -1214,7 +1207,7 @@ proc ::tk::MenuFindName {menu s} {
proc ::tk::PostOverPoint {menu x y {entry {}}} {
global tcl_platform
-
+
if {$entry ne ""} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \
@@ -1225,24 +1218,34 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} {
}
incr x [expr {-[winfo reqwidth $menu]/2}]
}
- if {$tcl_platform(platform) == "windows"} {
+
+ if {[tk windowingsystem] eq "win32"} {
+ # osVersion is not available in safe interps
+ set ver 5
+ if {[info exists tcl_platform(osVersion)]} {
+ scan $tcl_platform(osVersion) %d ver
+ }
+
# We need to fix some problems with menu posting on Windows,
# where, if the menu would overlap top or bottom of screen,
# Windows puts it in the wrong place for us. We must also
# subtract an extra amount for half the height of the current
# entry. To be safe we subtract an extra 10.
- set yoffset [expr {[winfo screenheight $menu] \
- - $y - [winfo reqheight $menu] - 10}]
- if {$yoffset < 0} {
- # The bottom of the menu is offscreen, so adjust upwards
- incr y $yoffset
- if {$y < 0} { set y 0 }
- }
- # If we're off the top of the screen (either because we were
- # originally or because we just adjusted too far upwards),
- # then make the menu popup on the top edge.
- if {$y < 0} {
- set y 0
+ # NOTE: this issue appears to have been resolved in the Window
+ # manager provided with Vista and Windows 7.
+ if {$ver < 6} {
+ set yoffset [expr {[winfo screenheight $menu] \
+ - $y - [winfo reqheight $menu] - 10}]
+ if {$yoffset < [winfo vrooty $menu]} {
+ # The bottom of the menu is offscreen, so adjust upwards
+ incr y [expr {$yoffset - [winfo vrooty $menu]}]
+ }
+ # If we're off the top of the screen (either because we were
+ # originally or because we just adjusted too far upwards),
+ # then make the menu popup on the top edge.
+ if {$y < [winfo vrooty $menu]} {
+ set y [winfo vrooty $menu]
+ }
}
}
$menu post $x $y
@@ -1276,7 +1279,7 @@ proc ::tk::RestoreOldGrab {} {
variable ::tk::Priv
if {$Priv(oldGrab) ne ""} {
- # Be careful restoring the old grab, since it's window may not
+ # Be careful restoring the old grab, since it's window may not
# be visible anymore.
catch {
@@ -1297,7 +1300,7 @@ proc ::tk_menuSetFocus {menu} {
}
focus $menu
}
-
+
proc ::tk::GenerateMenuSelect {menu} {
variable ::tk::Priv
diff --git a/library/mkpsenc.tcl b/library/mkpsenc.tcl
index e3c5f46..50224eb 100644
--- a/library/mkpsenc.tcl
+++ b/library/mkpsenc.tcl
@@ -1128,7 +1128,6 @@ namespace eval ::tk {
%%BeginProlog
% This is a standard prolog for Postscript generated by Tk's canvas
% widget.
- % RCS: @(#) $Id: mkpsenc.tcl,v 1.7 2010/01/03 16:24:13 dkf Exp $
}
ps variable CurrentEncoding [CreatePostscriptEncoding]
ps literal {50 dict begin}
diff --git a/library/msgbox.tcl b/library/msgbox.tcl
index 9b95efa..60a2a19 100644
--- a/library/msgbox.tcl
+++ b/library/msgbox.tcl
@@ -3,8 +3,6 @@
# Implements messageboxes for platforms that do not have native
# messagebox support.
#
-# RCS: @(#) $Id: msgbox.tcl,v 1.41 2011/01/13 07:39:12 nijtmans Exp $
-#
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
@@ -397,7 +395,7 @@ proc ::tk::MessageBox {args} {
# 7. Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
- # display and de-iconify it.
+ # display (Motif style) and de-iconify it.
::tk::PlaceWindow $w widget $data(-parent)
diff --git a/library/obsolete.tcl b/library/obsolete.tcl
index 64852d8..3ee7f28 100644
--- a/library/obsolete.tcl
+++ b/library/obsolete.tcl
@@ -3,8 +3,6 @@
# This file contains obsolete procedures that people really shouldn't
# be using anymore, but which are kept around for backward compatibility.
#
-# RCS: @(#) $Id: obsolete.tcl,v 1.6 2010/01/09 00:48:36 patthoyts Exp $
-#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
#
diff --git a/library/optMenu.tcl b/library/optMenu.tcl
index 4f688a5..7cfdaa0 100644
--- a/library/optMenu.tcl
+++ b/library/optMenu.tcl
@@ -3,8 +3,6 @@
# This file defines the procedure tk_optionMenu, which creates
# an option button and its associated menu.
#
-# RCS: @(#) $Id: optMenu.tcl,v 1.6 2007/12/13 15:26:27 dgp Exp $
-#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
#
diff --git a/library/palette.tcl b/library/palette.tcl
index 57a5641..21be8dc 100644
--- a/library/palette.tcl
+++ b/library/palette.tcl
@@ -3,8 +3,6 @@
# This file contains procedures that change the color palette used
# by Tk.
#
-# RCS: @(#) $Id: palette.tcl,v 1.13 2009/04/10 16:52:54 jenglish Exp $
-#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
diff --git a/library/panedwindow.tcl b/library/panedwindow.tcl
index f1f9f9a..d3dfabc 100644
--- a/library/panedwindow.tcl
+++ b/library/panedwindow.tcl
@@ -2,9 +2,6 @@
#
# This file defines the default bindings for Tk panedwindow widgets and
# provides procedures that help in implementing those bindings.
-#
-# RCS: @(#) $Id: panedwindow.tcl,v 1.11 2005/07/25 09:06:00 dkf Exp $
-#
bind Panedwindow <Button-1> { ::tk::panedwindow::MarkSash %W %x %y 1 }
bind Panedwindow <Button-2> { ::tk::panedwindow::MarkSash %W %x %y 0 }
diff --git a/library/safetk.tcl b/library/safetk.tcl
index 8effc2a..e664ace 100644
--- a/library/safetk.tcl
+++ b/library/safetk.tcl
@@ -2,8 +2,6 @@
#
# Support procs to use Tk in safe interpreters.
#
-# RCS: @(#) $Id: safetk.tcl,v 1.13 2009/11/23 19:17:30 andreas_kupries Exp $
-#
# Copyright (c) 1997 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
diff --git a/library/scale.tcl b/library/scale.tcl
index 9f8f110..d9e7d27 100644
--- a/library/scale.tcl
+++ b/library/scale.tcl
@@ -3,8 +3,6 @@
# This file defines the default bindings for Tk scale widgets and provides
# procedures that help in implementing the bindings.
#
-# RCS: @(#) $Id: scale.tcl,v 1.14 2006/03/17 11:13:15 patthoyts Exp $
-#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
#
@@ -62,7 +60,7 @@ bind Scale <ButtonRelease-2> {
tk::ScaleEndDrag %W
tk::ScaleActivate %W %x %y
}
-if {$tcl_platform(platform) eq "windows"} {
+if {[tk windowingsystem] eq "win32"} {
# On Windows do the same with button 3, as that is the right mouse button
bind Scale <3> [bind Scale <2>]
bind Scale <B3-Motion> [bind Scale <B2-Motion>]
@@ -73,34 +71,34 @@ if {$tcl_platform(platform) eq "windows"} {
bind Scale <Control-1> {
tk::ScaleControlPress %W %x %y
}
-bind Scale <Up> {
+bind Scale <<PrevLine>> {
tk::ScaleIncrement %W up little noRepeat
}
-bind Scale <Down> {
+bind Scale <<NextLine>> {
tk::ScaleIncrement %W down little noRepeat
}
-bind Scale <Left> {
+bind Scale <<PrevChar>> {
tk::ScaleIncrement %W up little noRepeat
}
-bind Scale <Right> {
+bind Scale <<NextChar>> {
tk::ScaleIncrement %W down little noRepeat
}
-bind Scale <Control-Up> {
+bind Scale <<PrevPara>> {
tk::ScaleIncrement %W up big noRepeat
}
-bind Scale <Control-Down> {
+bind Scale <<NextPara>> {
tk::ScaleIncrement %W down big noRepeat
}
-bind Scale <Control-Left> {
+bind Scale <<PrevWord>> {
tk::ScaleIncrement %W up big noRepeat
}
-bind Scale <Control-Right> {
+bind Scale <<NextWord>> {
tk::ScaleIncrement %W down big noRepeat
}
-bind Scale <Home> {
+bind Scale <<LineStart>> {
%W set [%W cget -from]
}
-bind Scale <End> {
+bind Scale <<LineEnd>> {
%W set [%W cget -to]
}
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 21eaa02..1f8c7d2 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -3,8 +3,6 @@
# This file defines the default bindings for Tk scrollbar widgets.
# It also provides procedures that help in implementing the bindings.
#
-# RCS: @(#) $Id: scrlbar.tcl,v 1.14 2008/12/28 23:43:14 dkf Exp $
-#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
#
@@ -93,28 +91,28 @@ bind Scrollbar <Control-2> {
tk::ScrollTopBottom %W %x %y
}
-bind Scrollbar <Up> {
+bind Scrollbar <<PrevLine>> {
tk::ScrollByUnits %W v -1
}
-bind Scrollbar <Down> {
+bind Scrollbar <<NextLine>> {
tk::ScrollByUnits %W v 1
}
-bind Scrollbar <Control-Up> {
+bind Scrollbar <<PrevPara>> {
tk::ScrollByPages %W v -1
}
-bind Scrollbar <Control-Down> {
+bind Scrollbar <<NextPara>> {
tk::ScrollByPages %W v 1
}
-bind Scrollbar <Left> {
+bind Scrollbar <<PrevChar>> {
tk::ScrollByUnits %W h -1
}
-bind Scrollbar <Right> {
+bind Scrollbar <<NextChar>> {
tk::ScrollByUnits %W h 1
}
-bind Scrollbar <Control-Left> {
+bind Scrollbar <<PrevWord>> {
tk::ScrollByPages %W h -1
}
-bind Scrollbar <Control-Right> {
+bind Scrollbar <<NextWord>> {
tk::ScrollByPages %W h 1
}
bind Scrollbar <Prior> {
@@ -123,10 +121,10 @@ bind Scrollbar <Prior> {
bind Scrollbar <Next> {
tk::ScrollByPages %W hv 1
}
-bind Scrollbar <Home> {
+bind Scrollbar <<LineStart>> {
tk::ScrollToPos %W 0
}
-bind Scrollbar <End> {
+bind Scrollbar <<LineEnd>> {
tk::ScrollToPos %W 1
}
}
diff --git a/library/spinbox.tcl b/library/spinbox.tcl
index 4df106f..06c002c 100644
--- a/library/spinbox.tcl
+++ b/library/spinbox.tcl
@@ -4,8 +4,6 @@
# procedures that help in implementing those bindings. The spinbox builds
# off the entry widget, so it can reuse Entry bindings and procedures.
#
-# RCS: @(#) $Id: spinbox.tcl,v 1.10 2010/01/06 18:37:36 dkf Exp $
-#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1999-2000 Jeffrey Hobbs
@@ -122,10 +120,10 @@ bind Spinbox <Control-1> {
%W icursor @%x
}
-bind Spinbox <Up> {
+bind Spinbox <<PrevLine>> {
%W invoke buttonup
}
-bind Spinbox <Down> {
+bind Spinbox <<NextLine>> {
%W invoke buttondown
}
@@ -195,10 +193,10 @@ bind Spinbox <Control-Shift-space> {
bind Spinbox <Shift-Select> {
%W selection adjust insert
}
-bind Spinbox <Control-slash> {
+bind Spinbox <<SelectAll>> {
%W selection range 0 end
}
-bind Spinbox <Control-backslash> {
+bind Spinbox <<SelectNone>> {
%W selection clear
}
bind Spinbox <KeyPress> {
@@ -225,7 +223,7 @@ if {[tk windowingsystem] eq "aqua"} {
# On Windows, paste is done using Shift-Insert. Shift-Insert already
# generates the <<Paste>> event, so we don't need to do anything here.
-if {$tcl_platform(platform) ne "windows"} {
+if {[tk windowingsystem] ne "win32"} {
bind Spinbox <Insert> {
catch {::tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]}
}
@@ -233,31 +231,11 @@ if {$tcl_platform(platform) ne "windows"} {
# Additional emacs-like bindings:
-bind Spinbox <Control-a> {
- if {!$tk_strictMotif} {
- ::tk::EntrySetCursor %W 0
- }
-}
-bind Spinbox <Control-b> {
- if {!$tk_strictMotif} {
- ::tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
- }
-}
bind Spinbox <Control-d> {
if {!$tk_strictMotif} {
%W delete insert
}
}
-bind Spinbox <Control-e> {
- if {!$tk_strictMotif} {
- ::tk::EntrySetCursor %W end
- }
-}
-bind Spinbox <Control-f> {
- if {!$tk_strictMotif} {
- ::tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
- }
-}
bind Spinbox <Control-h> {
if {!$tk_strictMotif} {
::tk::EntryBackspace %W
diff --git a/library/tearoff.tcl b/library/tearoff.tcl
index 46e442d..6da2a0f 100644
--- a/library/tearoff.tcl
+++ b/library/tearoff.tcl
@@ -2,8 +2,6 @@
#
# This file contains procedures that implement tear-off menus.
#
-# RCS: @(#) $Id: tearoff.tcl,v 1.12 2010/01/03 01:15:08 patthoyts Exp $
-#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
#
diff --git a/library/text.tcl b/library/text.tcl
index c609665..e59a86e 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -3,8 +3,6 @@
# This file defines the default bindings for Tk text widgets and provides
# procedures that help in implementing the bindings.
#
-# RCS: @(#) $Id: text.tcl,v 1.46 2010/06/15 14:30:48 dkf Exp $
-#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998 by Scriptics Corporation.
@@ -94,10 +92,10 @@ bind Text <<PrevChar>> {
bind Text <<NextChar>> {
tk::TextSetCursor %W insert+1displayindices
}
-bind Text <Up> {
+bind Text <<PrevLine>> {
tk::TextSetCursor %W [tk::TextUpDownLine %W -1]
}
-bind Text <Down> {
+bind Text <<NextLine>> {
tk::TextSetCursor %W [tk::TextUpDownLine %W 1]
}
bind Text <<SelectPrevChar>> {
@@ -106,10 +104,10 @@ bind Text <<SelectPrevChar>> {
bind Text <<SelectNextChar>> {
tk::TextKeySelect %W [%W index {insert + 1displayindices}]
}
-bind Text <Shift-Up> {
+bind Text <<SelectPrevLine>> {
tk::TextKeySelect %W [tk::TextUpDownLine %W -1]
}
-bind Text <Shift-Down> {
+bind Text <<SelectNextLine>> {
tk::TextKeySelect %W [tk::TextUpDownLine %W 1]
}
bind Text <<PrevWord>> {
@@ -118,10 +116,10 @@ bind Text <<PrevWord>> {
bind Text <<NextWord>> {
tk::TextSetCursor %W [tk::TextNextWord %W insert]
}
-bind Text <Control-Up> {
+bind Text <<PrevPara>> {
tk::TextSetCursor %W [tk::TextPrevPara %W insert]
}
-bind Text <Control-Down> {
+bind Text <<NextPara>> {
tk::TextSetCursor %W [tk::TextNextPara %W insert]
}
bind Text <<SelectPrevWord>> {
@@ -130,10 +128,10 @@ bind Text <<SelectPrevWord>> {
bind Text <<SelectNextWord>> {
tk::TextKeySelect %W [tk::TextNextWord %W insert]
}
-bind Text <Shift-Control-Up> {
+bind Text <<SelectPrevPara>> {
tk::TextKeySelect %W [tk::TextPrevPara %W insert]
}
-bind Text <Shift-Control-Down> {
+bind Text <<SelectNextPara>> {
tk::TextKeySelect %W [tk::TextNextPara %W insert]
}
bind Text <Prior> {
@@ -242,10 +240,10 @@ bind Text <Shift-Select> {
set tk::Priv(selectMode) char
tk::TextKeyExtend %W insert
}
-bind Text <Control-slash> {
+bind Text <<SelectAll>> {
%W tag add sel 1.0 end
}
-bind Text <Control-backslash> {
+bind Text <<SelectNone>> {
%W tag remove sel 1.0 end
}
bind Text <<Cut>> {
@@ -289,31 +287,11 @@ if {[tk windowingsystem] eq "aqua"} {
# Additional emacs-like bindings:
-bind Text <Control-a> {
- if {!$tk_strictMotif} {
- tk::TextSetCursor %W {insert display linestart}
- }
-}
-bind Text <Control-b> {
- if {!$tk_strictMotif} {
- tk::TextSetCursor %W insert-1displayindices
- }
-}
bind Text <Control-d> {
if {!$tk_strictMotif && [%W compare end != insert+1c]} {
%W delete insert
}
}
-bind Text <Control-e> {
- if {!$tk_strictMotif} {
- tk::TextSetCursor %W {insert display lineend}
- }
-}
-bind Text <Control-f> {
- if {!$tk_strictMotif} {
- tk::TextSetCursor %W insert+1displayindices
- }
-}
bind Text <Control-k> {
if {!$tk_strictMotif && [%W compare end != insert+1c]} {
if {[%W compare insert == {insert lineend}]} {
@@ -323,22 +301,12 @@ bind Text <Control-k> {
}
}
}
-bind Text <Control-n> {
- if {!$tk_strictMotif} {
- tk::TextSetCursor %W [tk::TextUpDownLine %W 1]
- }
-}
bind Text <Control-o> {
if {!$tk_strictMotif} {
%W insert insert \n
%W mark set insert insert-1c
}
}
-bind Text <Control-p> {
- if {!$tk_strictMotif} {
- tk::TextSetCursor %W [tk::TextUpDownLine %W -1]
- }
-}
bind Text <Control-t> {
if {!$tk_strictMotif} {
tk::TextTranspose %W
@@ -392,31 +360,7 @@ bind Text <Meta-Delete> {
# Macintosh only bindings:
if {[tk windowingsystem] eq "aqua"} {
-bind Text <Option-Left> {
- tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
-}
-bind Text <Option-Right> {
- tk::TextSetCursor %W [tk::TextNextWord %W insert]
-}
-bind Text <Option-Up> {
- tk::TextSetCursor %W [tk::TextPrevPara %W insert]
-}
-bind Text <Option-Down> {
- tk::TextSetCursor %W [tk::TextNextPara %W insert]
-}
-bind Text <Shift-Option-Left> {
- tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
-}
-bind Text <Shift-Option-Right> {
- tk::TextKeySelect %W [tk::TextNextWord %W insert]
-}
-bind Text <Shift-Option-Up> {
- tk::TextKeySelect %W [tk::TextPrevPara %W insert]
-}
-bind Text <Shift-Option-Down> {
- tk::TextKeySelect %W [tk::TextNextPara %W insert]
-}
-bind Text <Control-v> {
+bind Text <<Paste>> {
tk::TextScrollPages %W 1
}
@@ -562,7 +506,7 @@ proc ::tk::TextButton1 {w x y} {
}
# Allow focus in any case on Windows, because that will let the
# selection be displayed even for state disabled text widgets.
- if {$::tcl_platform(platform) eq "windows" \
+ if {[tk windowingsystem] eq "win32" \
|| [$w cget -state] eq "normal"} {
focus $w
}
@@ -1120,7 +1064,7 @@ proc ::tk_textPaste w {
# w - The text window in which the cursor is to move.
# start - Position at which to start search.
-if {$tcl_platform(platform) eq "windows"} {
+if {[tk windowingsystem] eq "win32"} {
proc ::tk::TextNextWord {w start} {
TextNextPos $w [TextNextPos $w $start tcl_endOfWord] \
tcl_startOfNextWord
diff --git a/library/tk.tcl b/library/tk.tcl
index 71afb6e..cac9075 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -3,8 +3,6 @@
# Initialization script normally executed in the interpreter for each Tk-based
# application. Arranges class bindings for widgets.
#
-# RCS: @(#) $Id: tk.tcl,v 1.91 2010/05/03 16:30:15 dgp Exp $
-#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
@@ -15,7 +13,7 @@
# Insist on running with compatible version of Tcl
package require Tcl 8.6
# Verify that we have Tk binary and script components from the same release
-package require -exact Tk 8.6b1.2
+package require -exact Tk 8.6b2
# Create a ::tk namespace
namespace eval ::tk {
@@ -113,20 +111,16 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
set checkBounds 0
}
- if {[tk windowingsystem] eq "win32"} {
- # Bug 533519: win32 multiple desktops may produce negative geometry.
- set checkBounds 0
- }
if {$checkBounds} {
- if {$x < 0} {
- set x 0
- } elseif {$x > ([winfo screenwidth $w]-[winfo reqwidth $w])} {
- set x [expr {[winfo screenwidth $w]-[winfo reqwidth $w]}]
+ if {$x < [winfo vrootx $w]} {
+ set x [winfo vrootx $w]
+ } elseif {$x > ([winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w])} {
+ set x [expr {[winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w]}]
}
- if {$y < 0} {
- set y 0
- } elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} {
- set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}]
+ if {$y < [winfo vrooty $w]} {
+ set y [winfo vrooty $w]
+ } elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} {
+ set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}]
}
if {[tk windowingsystem] eq "aqua"} {
# Avoid the native menu bar which sits on top of everything.
@@ -135,6 +129,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
}
}
}
+ wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w]
wm geometry $w +$x+$y
wm deiconify $w
}
@@ -211,7 +206,7 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
# Results:
# Returns the selection, or an error if none could be found
#
-if {$tcl_platform(platform) eq "unix"} {
+if {[tk windowingsystem] ne "win32"} {
proc ::tk::GetSelection {w {sel PRIMARY}} {
if {[catch {
selection get -displayof $w -selection $sel -type UTF8_STRING
@@ -312,9 +307,9 @@ proc ::tk::EventMotifBindings {n1 dummy dummy} {
set op add
}
- event $op <<Cut>> <Control-Key-w>
- event $op <<Copy>> <Meta-Key-w>
- event $op <<Paste>> <Control-Key-y>
+ event $op <<Cut>> <Control-Key-w> <Shift-Key-Delete>
+ event $op <<Copy>> <Meta-Key-w> <Control-Key-Insert>
+ event $op <<Paste>> <Control-Key-y> <Shift-Key-Insert>
event $op <<Undo>> <Control-underscore>
}
@@ -363,29 +358,40 @@ if {![llength [info command tk_chooseDirectory]]} {
switch -exact -- [tk windowingsystem] {
"x11" {
- event add <<Cut>> <Control-Key-x> <Key-F20> <Control-Lock-Key-X>
- event add <<Copy>> <Control-Key-c> <Key-F16> <Control-Lock-Key-C>
- event add <<Paste>> <Control-Key-v> <Key-F18> <Control-Lock-Key-V>
- event add <<PasteSelection>> <ButtonRelease-2>
- event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z>
- event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z>
- event add <<ContextMenu>> <Button-3>
+ event add <<Cut>> <Control-Key-x> <Key-F20> <Control-Lock-Key-X>
+ event add <<Copy>> <Control-Key-c> <Key-F16> <Control-Lock-Key-C>
+ event add <<Paste>> <Control-Key-v> <Key-F18> <Control-Lock-Key-V>
+ event add <<PasteSelection>> <ButtonRelease-2>
+ event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z>
+ event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z>
+ event add <<ContextMenu>> <Button-3>
if {[info exists tcl_platform(os)] && $tcl_platform(os) eq "Darwin"} {
- event add <<ContextMenu>> <Button-2>
+ event add <<ContextMenu>> <Button-2>
}
- event add <<NextChar>> <Right>
- event add <<SelectNextChar>> <Shift-Right>
- event add <<PrevChar>> <Left>
- event add <<SelectPrevChar>> <Shift-Left>
+ event add <<SelectAll>> <Control-Key-slash>
+ event add <<SelectNone>> <Control-Key-backslash>
+ event add <<NextChar>> <Right> <Control-Key-f> <Control-Lock-Key-F>
+ event add <<SelectNextChar>> <Shift-Right> <Control-Key-F> <Control-Lock-Key-f>
+ event add <<PrevChar>> <Left> <Control-Key-b> <Control-Lock-Key-B>
+ event add <<SelectPrevChar>> <Shift-Left> <Control-Key-B> <Control-Lock-Key-b>
event add <<NextWord>> <Control-Right>
- event add <<SelectNextWord>> <Shift-Control-Right>
+ event add <<SelectNextWord>> <Control-Shift-Right>
event add <<PrevWord>> <Control-Left>
- event add <<SelectPrevWord>> <Shift-Control-Left>
- event add <<LineStart>> <Home>
- event add <<SelectLineStart>> <Shift-Home>
- event add <<LineEnd>> <End>
- event add <<SelectLineEnd>> <Shift-End>
+ event add <<SelectPrevWord>> <Control-Shift-Left>
+ event add <<LineStart>> <Home> <Control-Key-a> <Control-Lock-Key-A>
+ event add <<SelectLineStart>> <Shift-Home> <Control-Key-A> <Control-Lock-Key-a>
+ event add <<LineEnd>> <End> <Control-Key-e> <Control-Lock-Key-E>
+ event add <<SelectLineEnd>> <Shift-End> <Control-Key-E> <Control-Lock-Key-e>
+ event add <<PrevLine>> <Up> <Control-Key-p> <Control-Lock-Key-P>
+ event add <<NextLine>> <Down> <Control-Key-n> <Control-Lock-Key-N>
+ event add <<SelectPrevLine>> <Shift-Up> <Control-Key-P> <Control-Lock-Key-p>
+ event add <<SelectNextLine>> <Shift-Down> <Control-Key-N> <Control-Lock-Key-n>
+ event add <<PrevPara>> <Control-Up>
+ event add <<NextPara>> <Control-Down>
+ event add <<SelectPrevPara>> <Control-Shift-Up>
+ event add <<SelectPrevPara>> <Control-Shift-Down>
+ event add <<ToggleSelection>> <Control-ButtonPress-1>
# Some OS's define a goofy (as in, not <Shift-Tab>) keysym that is
# returned when the user presses <Shift-Tab>. In order for tab
@@ -404,56 +410,75 @@ switch -exact -- [tk windowingsystem] {
set ::tk::AlwaysShowSelection 1
}
"win32" {
- event add <<Cut>> <Control-Key-x> <Shift-Key-Delete> \
- <Control-Lock-Key-X>
- event add <<Copy>> <Control-Key-c> <Control-Key-Insert> \
- <Control-Lock-Key-C>
- event add <<Paste>> <Control-Key-v> <Shift-Key-Insert> \
- <Control-Lock-Key-V>
- event add <<PasteSelection>> <ButtonRelease-2>
- event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z>
- event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y>
- event add <<ContextMenu>> <Button-3>
-
+ event add <<Cut>> <Control-Key-x> <Shift-Key-Delete> <Control-Lock-Key-X>
+ event add <<Copy>> <Control-Key-c> <Control-Key-Insert> <Control-Lock-Key-C>
+ event add <<Paste>> <Control-Key-v> <Shift-Key-Insert> <Control-Lock-Key-V>
+ event add <<PasteSelection>> <ButtonRelease-2>
+ event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z>
+ event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y>
+ event add <<ContextMenu>> <Button-3>
+
+ event add <<SelectAll>> <Control-Key-slash> <Control-Key-a> <Control-Lock-Key-A>
+ event add <<SelectNone>> <Control-Key-backslash>
event add <<NextChar>> <Right>
event add <<SelectNextChar>> <Shift-Right>
event add <<PrevChar>> <Left>
event add <<SelectPrevChar>> <Shift-Left>
event add <<NextWord>> <Control-Right>
- event add <<SelectNextWord>> <Shift-Control-Right>
+ event add <<SelectNextWord>> <Control-Shift-Right>
event add <<PrevWord>> <Control-Left>
- event add <<SelectPrevWord>> <Shift-Control-Left>
+ event add <<SelectPrevWord>> <Control-Shift-Left>
event add <<LineStart>> <Home>
event add <<SelectLineStart>> <Shift-Home>
event add <<LineEnd>> <End>
event add <<SelectLineEnd>> <Shift-End>
+ event add <<PrevLine>> <Up>
+ event add <<NextLine>> <Down>
+ event add <<SelectPrevLine>> <Shift-Up>
+ event add <<SelectNextLine>> <Shift-Down>
+ event add <<PrevPara>> <Control-Up>
+ event add <<NextPara>> <Control-Down>
+ event add <<SelectPrevPara>> <Control-Shift-Up>
+ event add <<SelectPrevPara>> <Control-Shift-Down>
+ event add <<ToggleSelection>> <Control-ButtonPress-1>
}
"aqua" {
- event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X>
- event add <<Copy>> <Command-Key-c> <Key-F3> <Control-Lock-Key-C>
- event add <<Paste>> <Command-Key-v> <Key-F4> <Control-Lock-Key-V>
- event add <<PasteSelection>> <ButtonRelease-2>
- event add <<Clear>> <Clear>
- event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z>
- event add <<Redo>> <Command-Key-y> <Control-Lock-Key-Y>
- event add <<ContextMenu>> <Button-2>
+ event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X>
+ event add <<Copy>> <Command-Key-c> <Key-F3> <Control-Lock-Key-C>
+ event add <<Paste>> <Command-Key-v> <Key-F4> <Control-Lock-Key-V>
+ event add <<PasteSelection>> <ButtonRelease-2>
+ event add <<Clear>> <Clear>
+ event add <<ContextMenu>> <Button-2>
# Official bindings
# See http://support.apple.com/kb/HT1343
- event add <<NextChar>> <Right>
- event add <<SelectNextChar>> <Shift-Right>
- event add <<PrevChar>> <Left>
- event add <<SelectPrevChar>> <Shift-Left>
+ event add <<SelectAll>> <Command-Key-a>
+ event add <<SelectNone>> <Option-Command-Key-a>
+ event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z>
+ event add <<Redo>> <Command-Key-Z> <Control-Lock-Key-z>
+ event add <<NextChar>> <Right> <Control-Key-f> <Control-Lock-Key-F>
+ event add <<SelectNextChar>> <Shift-Right> <Control-Key-F> <Control-Lock-Key-f>
+ event add <<PrevChar>> <Left> <Control-Key-b> <Control-Lock-Key-B>
+ event add <<SelectPrevChar>> <Shift-Left> <Control-Key-B> <Control-Lock-Key-b>
event add <<NextWord>> <Option-Right>
event add <<SelectNextWord>> <Shift-Option-Right>
event add <<PrevWord>> <Option-Left>
event add <<SelectPrevWord>> <Shift-Option-Left>
- event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left>
- event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right>
+ event add <<LineStart>> <Home> <Command-Left> <Control-Key-a> <Control-Lock-Key-A>
+ event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left> <Control-Key-A> <Control-Lock-Key-a>
+ event add <<LineEnd>> <End> <Command-Right> <Control-Key-e> <Control-Lock-Key-E>
+ event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right> <Control-Key-E> <Control-Lock-Key-e>
+ event add <<PrevLine>> <Up> <Control-Key-p> <Control-Lock-Key-P>
+ event add <<SelectPrevLine>> <Shift-Up> <Control-Key-P> <Control-Lock-Key-p>
+ event add <<NextLine>> <Down> <Control-Key-n> <Control-Lock-Key-N>
+ event add <<SelectNextLine>> <Shift-Down> <Control-Key-N> <Control-Lock-Key-n>
# Not official, but logical extensions of above. Also derived from
# bindings present in MS Word on OSX.
- event add <<LineStart>> <Home> <Command-Left>
- event add <<LineEnd>> <End> <Command-Right>
+ event add <<PrevPara>> <Option-Up>
+ event add <<NextPara>> <Option-Down>
+ event add <<SelectPrevPara>> <Shift-Option-Up>
+ event add <<SelectPrevPara>> <Shift-Option-Down>
+ event add <<ToggleSelection>> <Command-ButtonPress-1>
}
}
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index 0e091ab..ae16939 100644
--- a/library/tkfbox.tcl
+++ b/library/tkfbox.tcl
@@ -10,8 +10,6 @@
# "Directory" option menu. The user can select files by clicking on the
# file icons or by entering a filename in the "Filename:" entry.
#
-# RCS: @(#) $Id: tkfbox.tcl,v 1.76 2010/01/19 01:27:41 patthoyts Exp $
-#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
@@ -198,9 +196,9 @@ proc ::tk::dialog::file:: {type args} {
}
UpdateWhenIdle $w
- # Withdraw the window, then update all the geometry information so we know
- # how big it wants to be, then center the window in the display and
- # de-iconify it.
+ # Withdraw the window, then update all the geometry information
+ # so we know how big it wants to be, then center the window in the
+ # display (Motif style) and de-iconify it.
::tk::PlaceWindow $w widget $data(-parent)
wm title $w $data(-title)
@@ -268,6 +266,12 @@ proc ::tk::dialog::file::Config {dataName type argList} {
lappend specs {-multiple "" "" "0"}
}
+ # The "-confirmoverwrite" option is only for the "save" file dialog.
+ #
+ if {$type eq "save"} {
+ lappend specs {-confirmoverwrite "" "" "1"}
+ }
+
# 2: default values depending on the type of the dialog
#
if {![info exists data(selectPath)]} {
@@ -584,38 +588,15 @@ proc ::tk::dialog::file::Update {w} {
set showHidden $showHiddenVar
- # Make the dir list
- # Using -directory [pwd] is better in some VFS cases.
- set cmd [list glob -tails -directory [pwd] -type d -nocomplain *]
- if {$showHidden} {
- lappend cmd .*
- }
- set dirs [lsort -dictionary -unique [{*}$cmd]]
- set dirList {}
- foreach d $dirs {
- if {$d eq "." || $d eq ".."} {
- continue
- }
- lappend dirList $d
- }
- $data(icons) add $folder $dirList
+ # Make the dir list. Note that using an explicit [pwd] (instead of '.') is
+ # better in some VFS cases.
+ $data(icons) add $folder [GlobFiltered [pwd] d 1]
if {$class eq "TkFDialog"} {
# Make the file list if this is a File Dialog, selecting all but
# 'd'irectory type files.
#
- set cmd [list glob -tails -directory [pwd] \
- -type {f b c l p s} -nocomplain]
- if {$data(filter) eq "*"} {
- lappend cmd *
- if {$showHidden} {
- lappend cmd .*
- }
- } else {
- lappend cmd {*}$data(filter)
- }
- set fileList [lsort -dictionary -unique [{*}$cmd]]
- $data(icons) add $file $fileList
+ $data(icons) add $file [GlobFiltered [pwd] {f b c l p s}]
}
# Update the Directory: option menu
@@ -1123,7 +1104,7 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
set Priv(selectFile) $data(selectFile)
set Priv(selectPath) $data(selectPath)
- if {($data(type) eq "save") && [file exists $selectFilePath]} {
+ if {($data(type) eq "save") && $data(-confirmoverwrite) && [file exists $selectFilePath]} {
set reply [tk_messageBox -icon warning -type yesno -parent $w \
-message [mc "File \"%1\$s\" already exists.\nDo you want\
to overwrite it?" $selectFilePath]]
@@ -1144,50 +1125,72 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
set Priv(selectFilePath) $selectFilePath
}
+# ::tk::dialog::file::GlobFiltered --
+#
+# Gets called to do globbing, returning the results and filtering them
+# according to the current filter (and removing the entries for '.' and
+# '..' which are never shown). Deals with evil cases such as where the
+# user is supplying a filter which is an invalid list or where it has an
+# unbalanced brace. The resulting list will be dictionary sorted.
+#
+# Arguments:
+# dir Which directory to search
+# type List of filetypes to look for ('d' or 'f b c l p s')
+# overrideFilter Whether to ignore the filter for this search.
+#
+# NB: Assumes that the caller has mapped the state variable to 'data'.
+#
+proc ::tk::dialog::file::GlobFiltered {dir type {overrideFilter 0}} {
+ variable showHiddenVar
+ upvar 1 data(filter) filter
+
+ if {$filter eq "*" || $overrideFilter} {
+ set patterns [list *]
+ if {$showHiddenVar} {
+ lappend patterns .*
+ }
+ } elseif {[string is list $filter]} {
+ set patterns $filter
+ } else {
+ # Invalid list; assume we can use non-whitespace sequences as words
+ set patterns [regexp -inline -all {\S+} $filter]
+ }
+
+ set opts [list -tails -directory $dir -type $type -nocomplain]
+
+ set result {}
+ catch {
+ # We have a catch because we might have a really bad pattern (e.g.,
+ # with an unbalanced brace); even [glob -nocomplain] doesn't like it.
+ # Using a catch ensures that it just means we match nothing instead of
+ # throwing a nasty error at the user...
+ foreach f [glob {*}$opts -- {*}$patterns] {
+ if {$f eq "." || $f eq ".."} {
+ continue
+ }
+ lappend result $f
+ }
+ }
+ return [lsort -dictionary -unique $result]
+}
+
proc ::tk::dialog::file::CompleteEnt {w} {
variable showHiddenVar
upvar ::tk::dialog::file::[winfo name $w] data
set f [$data(ent) get]
if {$data(-multiple)} {
- if {[catch {llength $f} len] || $len != 1} {
+ if {![string is list $f] || [llength $f] != 1} {
return -code break
}
set f [lindex $f 0]
}
# Get list of matching filenames and dirnames
- set globF [list glob -tails -directory $data(selectPath) \
- -type {f b c l p s} -nocomplain]
- set globD [list glob -tails -directory $data(selectPath) -type d \
- -nocomplain *]
- if {$data(filter) eq "*"} {
- lappend globF *
- if {$showHiddenVar} {
- lappend globF .*
- lappend globD .*
- }
- if {[winfo class $w] eq "TkFDialog"} {
- set files [lsort -dictionary -unique [{*}$globF]]
- } else {
- set files {}
- }
- set dirs [lsort -dictionary -unique [{*}$globD]]
- } else {
- if {$showHiddenVar} {
- lappend globD .*
- }
- if {[winfo class $w] eq "TkFDialog"} {
- set files [lsort -dictionary -unique [{*}$globF {*}$data(filter)]]
- } else {
- set files {}
- }
- set dirs [lsort -dictionary -unique [{*}$globD]]
- }
- # Filter specials
- set dirs [lsearch -all -not -exact -inline $dirs .]
- set dirs [lsearch -all -not -exact -inline $dirs ..]
+ set files [if {[winfo class $w] eq "TkFDialog"} {
+ GlobFiltered $data(selectPath) {f b c l p s}
+ }]
set dirs2 {}
- foreach d $dirs {lappend dirs2 $d/}
+ foreach d [GlobFiltered $data(selectPath) d] {lappend dirs2 $d/}
set targets [concat \
[lsearch -glob -all -inline $files $f*] \
diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl
index 5ed90eb..d57227c 100644
--- a/library/ttk/altTheme.tcl
+++ b/library/ttk/altTheme.tcl
@@ -1,6 +1,4 @@
#
-# $Id: altTheme.tcl,v 1.10 2008/12/31 21:25:34 jenglish Exp $
-#
# Ttk widget set: Alternate theme
#
diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl
index c457ab2..fa0fa12 100644
--- a/library/ttk/aquaTheme.tcl
+++ b/library/ttk/aquaTheme.tcl
@@ -1,6 +1,4 @@
#
-# $Id: aquaTheme.tcl,v 1.14 2009/07/15 21:50:40 das Exp $
-#
# Aqua theme (OSX native look and feel)
#
diff --git a/library/ttk/button.tcl b/library/ttk/button.tcl
index 22032e4..9f2cec7 100644
--- a/library/ttk/button.tcl
+++ b/library/ttk/button.tcl
@@ -1,6 +1,4 @@
#
-# $Id: button.tcl,v 1.3 2009/11/12 18:17:14 jenglish Exp $
-#
# Bindings for Buttons, Checkbuttons, and Radiobuttons.
#
# Notes: <Button1-Leave>, <Button1-Enter> only control the "pressed"
diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl
index 808c8a4..f184ea0 100644
--- a/library/ttk/clamTheme.tcl
+++ b/library/ttk/clamTheme.tcl
@@ -1,6 +1,4 @@
#
-# $Id: clamTheme.tcl,v 1.10 2008/12/07 18:42:55 jenglish Exp $
-#
# "Clam" theme.
#
# Inspired by the XFCE family of Gnome themes.
diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl
index fd2b280..7e3eff5 100644
--- a/library/ttk/classicTheme.tcl
+++ b/library/ttk/classicTheme.tcl
@@ -1,6 +1,4 @@
#
-# $Id: classicTheme.tcl,v 1.9 2008/11/29 00:43:48 patthoyts Exp $
-#
# "classic" Tk theme.
#
# Implements Tk's traditional Motif-like look and feel.
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl
index 20bfc07..03821a2 100644
--- a/library/ttk/combobox.tcl
+++ b/library/ttk/combobox.tcl
@@ -1,6 +1,4 @@
#
-# $Id: combobox.tcl,v 1.20 2010/01/19 01:27:41 patthoyts Exp $
-#
# Combobox bindings.
#
# <<NOTE-WM-TRANSIENT>>:
@@ -114,9 +112,12 @@ switch -- [tk windowingsystem] {
#
proc ttk::combobox::Press {mode w x y} {
variable State
+
+ $w instate disabled { return }
+
set State(entryPress) [expr {
- [$w instate {!readonly !disabled}]
- && [string match *textarea [$w identify $x $y]]
+ [$w instate !readonly]
+ && [string match *textarea [$w identify element $x $y]]
}]
focus $w
diff --git a/library/ttk/cursors.tcl b/library/ttk/cursors.tcl
index 8620098..75f7791 100644
--- a/library/ttk/cursors.tcl
+++ b/library/ttk/cursors.tcl
@@ -1,6 +1,4 @@
#
-# $Id: cursors.tcl,v 1.2 2008/10/28 20:02:03 jenglish Exp $
-#
# Map symbolic cursor names to platform-appropriate cursors.
#
# The following cursors are defined:
diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl
index 52a9d33..05a46bd 100644
--- a/library/ttk/defaults.tcl
+++ b/library/ttk/defaults.tcl
@@ -1,6 +1,4 @@
#
-# $Id: defaults.tcl,v 1.9 2008/11/29 00:43:48 patthoyts Exp $
-#
# Settings for default theme.
#
diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl
index 0e1194f..f5ba19e 100644
--- a/library/ttk/entry.tcl
+++ b/library/ttk/entry.tcl
@@ -1,6 +1,4 @@
#
-# $Id: entry.tcl,v 1.8 2010/03/17 09:27:23 dkf Exp $
-#
# DERIVED FROM: tk/library/entry.tcl r1.22
#
# Copyright (c) 1992-1994 The Regents of the University of California.
@@ -80,7 +78,7 @@ bind TEntry <B1-Leave> { ttk::Repeatedly ttk::entry::AutoScroll %W }
bind TEntry <B1-Enter> { ttk::CancelRepeat }
bind TEntry <ButtonRelease-1> { ttk::CancelRepeat }
-bind TEntry <Control-ButtonPress-1> {
+bind TEntry <<ToggleSelection>> {
%W instate {!readonly !disabled} { %W icursor @%x ; focus %W }
}
@@ -109,8 +107,8 @@ bind TEntry <<SelectNextWord>> { ttk::entry::Extend %W nextword }
bind TEntry <<SelectLineStart>> { ttk::entry::Extend %W home }
bind TEntry <<SelectLineEnd>> { ttk::entry::Extend %W end }
-bind TEntry <Control-Key-slash> { %W selection range 0 end }
-bind TEntry <Control-Key-backslash> { %W selection clear }
+bind TEntry <<SelectAll>> { %W selection range 0 end }
+bind TEntry <<SelectNone>> { %W selection clear }
bind TEntry <<TraverseIn>> { %W selection range 0 end; %W icursor end }
@@ -138,15 +136,13 @@ if {[tk windowingsystem] eq "aqua"} {
bind TEntry <Command-KeyPress> {# nothing}
}
# Tk-on-Cocoa generates characters for these two keys. [Bug 2971663]
-bind TEntry <Down> {# nothing}
-bind TEntry <Up> {# nothing}
+bind TEntry <<PrevLine>> {# nothing}
+bind TEntry <<NextLine>> {# nothing}
## Additional emacs-like bindings:
#
-bind TEntry <Control-Key-a> { ttk::entry::Move %W home }
bind TEntry <Control-Key-b> { ttk::entry::Move %W prevchar }
bind TEntry <Control-Key-d> { ttk::entry::Delete %W }
-bind TEntry <Control-Key-e> { ttk::entry::Move %W end }
bind TEntry <Control-Key-f> { ttk::entry::Move %W nextchar }
bind TEntry <Control-Key-h> { ttk::entry::Backspace %W }
bind TEntry <Control-Key-k> { %W delete insert end }
@@ -231,7 +227,7 @@ proc ttk::entry::See {w {index insert}} {
# position following the next end-of-word position.
#
set ::ttk::entry::State(startNext) \
- [string equal $::tcl_platform(platform) "windows"]
+ [string equal [tk windowingsystem] "win32"]
proc ttk::entry::NextWord {w start} {
variable State
diff --git a/library/ttk/fonts.tcl b/library/ttk/fonts.tcl
index 93ced36..52298c5 100644
--- a/library/ttk/fonts.tcl
+++ b/library/ttk/fonts.tcl
@@ -1,6 +1,4 @@
#
-# $Id: fonts.tcl,v 1.11 2007/12/13 15:27:08 dgp Exp $
-#
# Font specifications.
#
# This file, [source]d at initialization time, sets up the following
diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl
index fec276e..093bb02 100644
--- a/library/ttk/menubutton.tcl
+++ b/library/ttk/menubutton.tcl
@@ -1,6 +1,4 @@
#
-# $Id: menubutton.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
-#
# Bindings for Menubuttons.
#
# Menubuttons have three interaction modes:
diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl
index 04abdbe..72b85e6 100644
--- a/library/ttk/notebook.tcl
+++ b/library/ttk/notebook.tcl
@@ -1,6 +1,4 @@
#
-# $Id: notebook.tcl,v 1.6 2009/12/25 19:11:56 jenglish Exp $
-#
# Bindings for TNotebook widget
#
@@ -110,7 +108,7 @@ proc ttk::notebook::enableTraversal {nb} {
bind $top <Control-Key-Next> {+ttk::notebook::TLCycleTab %W 1}
bind $top <Control-Key-Prior> {+ttk::notebook::TLCycleTab %W -1}
bind $top <Control-Key-Tab> {+ttk::notebook::TLCycleTab %W 1}
- bind $top <Shift-Control-Key-Tab> {+ttk::notebook::TLCycleTab %W -1}
+ bind $top <Control-Shift-Key-Tab> {+ttk::notebook::TLCycleTab %W -1}
catch {
bind $top <Control-Key-ISO_Left_Tab> {+ttk::notebook::TLCycleTab %W -1}
}
@@ -172,7 +170,7 @@ proc ttk::notebook::EnclosingNotebook {w} {
}
# TLCycleTab --
-# toplevel binding procedure for Control-Tab / Shift-Control-Tab
+# toplevel binding procedure for Control-Tab / Control-Shift-Tab
# Select the next/previous tab in the nearest ancestor notebook.
#
proc ttk::notebook::TLCycleTab {w dir} {
diff --git a/library/ttk/panedwindow.tcl b/library/ttk/panedwindow.tcl
index 60d08be..a2e073b 100644
--- a/library/ttk/panedwindow.tcl
+++ b/library/ttk/panedwindow.tcl
@@ -1,6 +1,4 @@
#
-# $Id: panedwindow.tcl,v 1.6 2008/10/28 20:02:03 jenglish Exp $
-#
# Bindings for ttk::panedwindow widget.
#
diff --git a/library/ttk/progress.tcl b/library/ttk/progress.tcl
index f457bbe..b6e2ffb 100644
--- a/library/ttk/progress.tcl
+++ b/library/ttk/progress.tcl
@@ -1,6 +1,4 @@
#
-# $Id: progress.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
-#
# Ttk widget set: progress bar utilities.
#
diff --git a/library/ttk/scale.tcl b/library/ttk/scale.tcl
index 19c193f..69b9dd8 100644
--- a/library/ttk/scale.tcl
+++ b/library/ttk/scale.tcl
@@ -1,8 +1,6 @@
# scale.tcl - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
#
# Bindings for the TScale widget
-#
-# $Id: scale.tcl,v 1.2 2008/10/17 12:29:25 patthoyts Exp $
namespace eval ttk::scale {
variable State
@@ -23,16 +21,19 @@ bind TScale <ButtonPress-3> { ttk::scale::Jump %W %x %y }
bind TScale <B3-Motion> { ttk::scale::Drag %W %x %y }
bind TScale <ButtonRelease-3> { ttk::scale::Release %W %x %y }
-bind TScale <Left> { ttk::scale::Increment %W -1 }
-bind TScale <Up> { ttk::scale::Increment %W -1 }
-bind TScale <Right> { ttk::scale::Increment %W 1 }
-bind TScale <Down> { ttk::scale::Increment %W 1 }
-bind TScale <Control-Left> { ttk::scale::Increment %W -10 }
-bind TScale <Control-Up> { ttk::scale::Increment %W -10 }
-bind TScale <Control-Right> { ttk::scale::Increment %W 10 }
-bind TScale <Control-Down> { ttk::scale::Increment %W 10 }
-bind TScale <Home> { %W set [%W cget -from] }
-bind TScale <End> { %W set [%W cget -to] }
+## Keyboard navigation bindings:
+#
+bind TScale <<LineStart>> { %W set [%W cget -from] }
+bind TScale <<LineEnd>> { %W set [%W cget -to] }
+
+bind TScale <<PrevChar>> { ttk::scale::Increment %W -1 }
+bind TScale <<PrevLine>> { ttk::scale::Increment %W -1 }
+bind TScale <<NextChar>> { ttk::scale::Increment %W 1 }
+bind TScale <<NextLine>> { ttk::scale::Increment %W 1 }
+bind TScale <<PrevWord>> { ttk::scale::Increment %W -10 }
+bind TScale <<PrevPara>> { ttk::scale::Increment %W -10 }
+bind TScale <<NextWord>> { ttk::scale::Increment %W 10 }
+bind TScale <<NextPara>> { ttk::scale::Increment %W 10 }
proc ttk::scale::Press {w x y} {
variable State
diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl
index 27ac068..4bd5107 100644
--- a/library/ttk/scrollbar.tcl
+++ b/library/ttk/scrollbar.tcl
@@ -1,6 +1,4 @@
#
-# $Id: scrollbar.tcl,v 1.4 2007/12/13 15:27:08 dgp Exp $
-#
# Bindings for TScrollbar widget
#
diff --git a/library/ttk/sizegrip.tcl b/library/ttk/sizegrip.tcl
index ec0828a..153e310 100644
--- a/library/ttk/sizegrip.tcl
+++ b/library/ttk/sizegrip.tcl
@@ -1,6 +1,4 @@
#
-# $Id: sizegrip.tcl,v 1.4 2009/12/23 04:26:59 jenglish Exp $
-#
# Sizegrip widget bindings.
#
# Dragging a sizegrip widget resizes the containing toplevel.
diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl
index 9f7faa4..1aa0ccb 100644
--- a/library/ttk/spinbox.tcl
+++ b/library/ttk/spinbox.tcl
@@ -1,6 +1,4 @@
#
-# $Id: spinbox.tcl,v 1.3 2008/12/07 21:24:12 jenglish Exp $
-#
# ttk::spinbox bindings
#
diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl
index 6dc34ca..8772587 100644
--- a/library/ttk/treeview.tcl
+++ b/library/ttk/treeview.tcl
@@ -1,4 +1,3 @@
-# $Id: treeview.tcl,v 1.8 2009/11/12 18:17:14 jenglish Exp $
#
# ttk::treeview widget bindings and utilities.
#
@@ -44,7 +43,7 @@ bind Treeview <KeyPress-space> { ttk::treeview::ToggleFocus %W }
bind Treeview <Shift-ButtonPress-1> \
{ ttk::treeview::Select %W %x %y extend }
-bind Treeview <Control-ButtonPress-1> \
+bind Treeview <<ToggleSelection>> \
{ ttk::treeview::Select %W %x %y toggle }
ttk::copyBindings TtkScrollable Treeview
diff --git a/library/ttk/ttk.tcl b/library/ttk/ttk.tcl
index 0db16a0..7bae211 100644
--- a/library/ttk/ttk.tcl
+++ b/library/ttk/ttk.tcl
@@ -1,6 +1,4 @@
#
-# $Id: ttk.tcl,v 1.11 2010/06/15 16:59:16 jenglish Exp $
-#
# Ttk widget set initialization script.
#
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl
index a67b868..7cc1bb7 100644
--- a/library/ttk/utils.tcl
+++ b/library/ttk/utils.tcl
@@ -1,6 +1,4 @@
#
-# $Id: utils.tcl,v 1.8 2009/12/25 19:11:56 jenglish Exp $
-#
# Utilities for widget implementations.
#
diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl
index ec7cf02..55367bc 100644
--- a/library/ttk/winTheme.tcl
+++ b/library/ttk/winTheme.tcl
@@ -1,6 +1,4 @@
#
-# $Id: winTheme.tcl,v 1.10 2010/09/02 17:47:06 jenglish Exp $
-#
# Settings for 'winnative' theme.
#
diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl
index 5948b56..187ce0b 100644
--- a/library/ttk/xpTheme.tcl
+++ b/library/ttk/xpTheme.tcl
@@ -1,6 +1,4 @@
#
-# $Id: xpTheme.tcl,v 1.13 2010/09/02 17:47:06 jenglish Exp $
-#
# Settings for 'xpnative' theme
#
diff --git a/library/unsupported.tcl b/library/unsupported.tcl
index cb66a8f..feb9cc5 100644
--- a/library/unsupported.tcl
+++ b/library/unsupported.tcl
@@ -3,8 +3,6 @@
# Commands provided by Tk without official support. Use them at your
# own risk. They may change or go away without notice.
#
-# RCS: @(#) $Id: unsupported.tcl,v 1.6 2009/02/12 21:32:49 dkf Exp $
-#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl
index e89041e..a1d6048 100644
--- a/library/xmfbox.tcl
+++ b/library/xmfbox.tcl
@@ -4,8 +4,6 @@
# Unix platform. This implementation is used only if the
# "::tk_strictMotif" flag is set.
#
-# RCS: @(#) $Id: xmfbox.tcl,v 1.34 2009/10/22 10:12:57 dkf Exp $
-#
# Copyright (c) 1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Scriptics Corporation
#
@@ -248,8 +246,12 @@ proc ::tk::MotifFDialog_Config {dataName type argList} {
if {$type eq "open"} {
lappend specs {-multiple "" "" "0"}
}
+ if {$type eq "save"} {
+ lappend specs {-confirmoverwrite "" "" "1"}
+ }
set data(-multiple) 0
+ set data(-confirmoverwrite) 1
# 2: default values depending on the type of the dialog
#
if {![info exists data(selectPath)]} {
@@ -849,7 +851,7 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} {
-message [mc {File "%1$s" does not exist.} $item]
return
}
- } elseif {$data(type) eq "save"} {
+ } elseif {$data(type) eq "save" && $data(-confirmoverwrite)} {
set message [format %s%s \
[mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \
[mc {Replace existing file?}]]