summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
authordas <das>2007-11-01 11:34:00 (GMT)
committerdas <das>2007-11-01 11:34:00 (GMT)
commitae0d1d0b0c0c0da9b9740f79802008ea55487cef (patch)
tree94b2673dd9d3b89f36431bfbed2b98595fc0c18d /library/demos
parentd35b07014e59c53c9f6ce5a549cbb27d587e9f82 (diff)
downloadtk-ae0d1d0b0c0c0da9b9740f79802008ea55487cef.zip
tk-ae0d1d0b0c0c0da9b9740f79802008ea55487cef.tar.gz
tk-ae0d1d0b0c0c0da9b9740f79802008ea55487cef.tar.bz2
* library/demos/widget: increase height of main window text widget to
use more of the available vertical space.
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/widget12
1 files changed, 8 insertions, 4 deletions
diff --git a/library/demos/widget b/library/demos/widget
index 67dc893..333e29a 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -10,7 +10,7 @@ exec wish "$0" "$@"
# separate ".tcl" files is this directory, which are sourced by this script as
# needed.
#
-# RCS: @(#) $Id: widget,v 1.43 2007/10/31 16:17:57 dkf Exp $
+# RCS: @(#) $Id: widget,v 1.44 2007/11/01 11:34:00 das Exp $
package require Tcl 8.5
package require Tk 8.5
@@ -144,12 +144,16 @@ if {[tk windowingsystem] ne "aqua"} {
}
pack .statusBar -side bottom -fill x -pady 2
+set textheight 30
+catch {set textheight [expr {([winfo screenheight .] - 100) /
+ [font metrics mainFont -displayof . -linespace]}]}
+
ttk::frame .textFrame
scrollbar .s -orient vertical -command {.t yview} -takefocus 1
pack .s -in .textFrame -side right -fill y
-text .t -yscrollcommand {.s set} -wrap word -width 70 -height 30 \
- -font mainFont -setgrid 1 -highlightthickness 0 \
- -padx 4 -pady 2 -takefocus 0
+text .t -yscrollcommand {.s set} -wrap word -width 70 -height $textheight \
+ -font mainFont -setgrid 1 -highlightthickness 0 \
+ -padx 4 -pady 2 -takefocus 0
pack .t -in .textFrame -expand y -fill both -padx 1
pack .textFrame -expand yes -fill both
if {[tk windowingsystem] eq "aqua"} {