summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-10 14:57:13 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-10 14:57:13 (GMT)
commit538cdae2d292a523e1b72613162b236db2a16d08 (patch)
treefe09d282023ed498d42ae5a265d2031085f8fd6f
parentd965535fda1022e02c618349271e8ec7a26dccde (diff)
parentc8f0062c64f9fc019a92e9bbc8918aa3e4ba1571 (diff)
downloadtk-538cdae2d292a523e1b72613162b236db2a16d08.zip
tk-538cdae2d292a523e1b72613162b236db2a16d08.tar.gz
tk-538cdae2d292a523e1b72613162b236db2a16d08.tar.bz2
[Bug 3534137]: $tcl_platform(platform) != [tk windowingsystem]
-rw-r--r--ChangeLog5
-rw-r--r--library/bgerror.tcl2
-rw-r--r--library/button.tcl4
-rw-r--r--library/demos/menu.tcl2
-rw-r--r--library/demos/text.tcl6
-rw-r--r--library/entry.tcl4
-rw-r--r--library/menu.tcl2
-rw-r--r--library/scale.tcl2
-rw-r--r--library/spinbox.tcl2
-rw-r--r--library/text.tcl4
-rw-r--r--library/tk.tcl2
-rw-r--r--library/ttk/entry.tcl2
-rw-r--r--tests/constraints.tcl2
13 files changed, 22 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index c4703c1..c389c07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-10 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * library/*.tcl: [Bug 3534137]: $tcl_platform(platform) !=
+ [tk windowingsystem]
+
2012-06-08 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tkMain.c: Implement TkCygwinMainEx for loading
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index 0dc70cf..f46ab4c 100644
--- a/library/bgerror.tcl
+++ b/library/bgerror.tcl
@@ -223,7 +223,7 @@ proc ::tk::dialog::error::bgerror err {
# 7. 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 b817b76..d095b8a 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -39,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
}
@@ -131,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/demos/menu.tcl b/library/demos/menu.tcl
index ebd44f7..e19df57 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -56,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/text.tcl b/library/demos/text.tcl
index 21ee096..1b5f3b9 100644
--- a/library/demos/text.tcl
+++ b/library/demos/text.tcl
@@ -67,11 +67,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/entry.tcl b/library/entry.tcl
index 54f2136..382cc88 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -214,7 +214,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 Entry <Insert> {
catch {tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]}
}
@@ -574,7 +574,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/menu.tcl b/library/menu.tcl
index 5fb96fa..cc57532 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -1219,7 +1219,7 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} {
incr x [expr {-[winfo reqwidth $menu]/2}]
}
- if {$tcl_platform(platform) eq "windows"} {
+ if {[tk windowingsystem] eq "win32"} {
# osVersion is not available in safe interps
set ver 5
if {[info exists tcl_platform(osVersion)]} {
diff --git a/library/scale.tcl b/library/scale.tcl
index d362284..b4da824 100644
--- a/library/scale.tcl
+++ b/library/scale.tcl
@@ -60,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>]
diff --git a/library/spinbox.tcl b/library/spinbox.tcl
index c05ccec..cb501ee 100644
--- a/library/spinbox.tcl
+++ b/library/spinbox.tcl
@@ -221,7 +221,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]}
}
diff --git a/library/text.tcl b/library/text.tcl
index d4ff18e..0e43e61 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -539,7 +539,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
}
@@ -1096,7 +1096,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 b43b56a..e583967 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -205,7 +205,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} txt] \
diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl
index e60df90..2c9fbc8 100644
--- a/library/ttk/entry.tcl
+++ b/library/ttk/entry.tcl
@@ -229,7 +229,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/tests/constraints.tcl b/tests/constraints.tcl
index 843ee4d..bc2c09b 100644
--- a/tests/constraints.tcl
+++ b/tests/constraints.tcl
@@ -199,7 +199,7 @@ if {![string match {{22 3 6 15} {31 18 [34] 15}} $x]} {
testConstraint fonts 0
}
testConstraint textfonts [expr {
- [testConstraint fonts] || $tcl_platform(platform) eq "windows"
+ [testConstraint fonts] || [tk windowingsystem] eq "win32"
}]
# constraints for the visuals available..