summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-04 13:39:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-04 13:39:08 (GMT)
commit5ffd5c219c1ea9b074de229f1fe986a32da34205 (patch)
treed0924d5034ed4f337a8ae7617023abded73451aa /library
parentf464081c585024749fd04529a98af4d619cd737e (diff)
parentda54602493ccf28707320190ca559915a08e3003 (diff)
downloadtk-androwish.zip
tk-androwish.tar.gz
tk-androwish.tar.bz2
merge core-8-6-branch. Some upstream androwish changesandrowish
Diffstat (limited to 'library')
-rw-r--r--library/tk.tcl23
1 files changed, 16 insertions, 7 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index 5d8a670..9f04658 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -492,6 +492,20 @@ switch -exact -- [tk windowingsystem] {
}
# ----------------------------------------------------------------------
+# Setup flags/vars for SDL, screen dpi, and Android.
+# ----------------------------------------------------------------------
+
+namespace eval ::tk {
+ variable sdltk [expr {[info command "sdltk"] eq "sdltk"}]
+ variable dpi
+ set dpi [expr int((25.4 * [winfo screenwidth .]) / [winfo screenmmwidth .])]
+ variable android 0
+ if {$sdltk} {
+ set android [sdltk android]
+ }
+}
+
+# ----------------------------------------------------------------------
# Read in files that define all of the class bindings.
# ----------------------------------------------------------------------
@@ -500,12 +514,7 @@ if {$::tk_library ne ""} {
namespace eval :: [list source [file join $::tk_library $file.tcl]]
}
namespace eval ::tk {
- variable sdltk [expr {[info command "sdltk"] eq "sdltk"}]
- variable dpi
- set dpi [expr int((25.4 * [winfo screenwidth .]) / [winfo screenmmwidth .])]
- variable android 0
if {$sdltk} {
- set android [sdltk android]
if {$dpi < 140} {
SourceLibFile icons
} elseif {$dpi < 240} {
@@ -702,9 +711,9 @@ if {[tk windowingsystem] eq "aqua"} {
}
}
-if {[info command "sdltk"] eq "sdltk"} {
+if {$::tk::sdltk} {
# Android hardware keyboard handling
- if {[sdltk android]} {
+ if {$::tk::android} {
if {[package versions Borg] ne {}} {
package require Borg
}