summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordas <das>2007-04-29 02:24:49 (GMT)
committerdas <das>2007-04-29 02:24:49 (GMT)
commit1a476a1767db9dd2a37ed65dbe0cd3a24413d4b4 (patch)
tree83616c330ca5ebe0f636c1c22df4a55c86ce6f36 /library
parent1cb29bfc3b4440becbbb83a55e3617c04fd3f4f4 (diff)
downloadtk-1a476a1767db9dd2a37ed65dbe0cd3a24413d4b4.zip
tk-1a476a1767db9dd2a37ed65dbe0cd3a24413d4b4.tar.gz
tk-1a476a1767db9dd2a37ed65dbe0cd3a24413d4b4.tar.bz2
* library/bgerror.tcl: on aqua, use moveable alert resp. modal dialog
* library/dialog.tcl: window class and corresponding system background pattern; fix button padding. * library/tearoff.tcl: correct aqua menu bar height; vertically offset * library/tk.tcl: aqua tearoff floating window to match menu.
Diffstat (limited to 'library')
-rw-r--r--library/bgerror.tcl16
-rw-r--r--library/dialog.tcl8
-rw-r--r--library/tearoff.tcl8
-rw-r--r--library/tk.tcl6
4 files changed, 29 insertions, 9 deletions
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index 619a240..50933d4 100644
--- a/library/bgerror.tcl
+++ b/library/bgerror.tcl
@@ -9,8 +9,8 @@
# Copyright (c) 1998-2000 by Ajuba Solutions.
# All rights reserved.
#
-# RCS: @(#) $Id: bgerror.tcl,v 1.23.2.6 2006/06/22 00:37:01 hobbs Exp $
-# $Id: bgerror.tcl,v 1.23.2.6 2006/06/22 00:37:01 hobbs Exp $
+# RCS: @(#) $Id: bgerror.tcl,v 1.23.2.7 2007/04/29 02:24:49 das Exp $
+# $Id: bgerror.tcl,v 1.23.2.7 2007/04/29 02:24:49 das Exp $
namespace eval ::tk::dialog::error {
namespace import -force ::tk::msgcat::*
@@ -18,6 +18,12 @@ namespace eval ::tk::dialog::error {
option add *ErrorDialog.function.text [mc "Save To Log"] \
widgetDefault
option add *ErrorDialog.function.command [namespace code SaveToLog]
+ if {[tk windowingsystem] eq "aqua"} {
+ option add *ErrorDialog*background systemAlertBackgroundActive \
+ widgetDefault
+ option add *ErrorDialog*Button.highlightBackground \
+ systemAlertBackgroundActive widgetDefault
+ }
}
proc ::tk::dialog::error::Return {} {
@@ -141,7 +147,7 @@ proc ::tk::dialog::error::bgerror err {
if {($tcl_platform(platform) eq "macintosh")
|| ($windowingsystem eq "aqua")} {
- ::tk::unsupported::MacWindowStyle style .bgerrorDialog zoomDocProc
+ ::tk::unsupported::MacWindowStyle style .bgerrorDialog moveableAlert {}
}
frame .bgerrorDialog.bot
@@ -163,6 +169,9 @@ proc ::tk::dialog::error::bgerror err {
-relief $textRelief \
-highlightthickness $textHilight \
-wrap char
+ if {$windowingsystem eq "aqua"} {
+ $W.text configure -width 80 -background white
+ }
scrollbar $W.scroll -command [list $W.text yview]
pack $W.scroll -side right -fill y
@@ -222,6 +231,7 @@ proc ::tk::dialog::error::bgerror err {
if {($name eq "ok") || ($name eq "dismiss")} {
grid columnconfigure .bgerrorDialog.bot $i -minsize 79
}
+ grid configure .bgerrorDialog.$name -pady 7
}
incr i
}
diff --git a/library/dialog.tcl b/library/dialog.tcl
index 404593e..82f13fb 100644
--- a/library/dialog.tcl
+++ b/library/dialog.tcl
@@ -3,7 +3,7 @@
# 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.14.2.3 2006/01/25 18:21:41 dgp Exp $
+# RCS: @(#) $Id: dialog.tcl,v 1.14.2.4 2007/04/29 02:24:49 das Exp $
#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -69,7 +69,10 @@ proc ::tk_dialog {w title text bitmap default args} {
set windowingsystem [tk windowingsystem]
if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} {
- ::tk::unsupported::MacWindowStyle style $w dBoxProc
+ ::tk::unsupported::MacWindowStyle style $w moveableModal {}
+ option add *Dialog*background systemDialogBackgroundActive widgetDefault
+ option add *Dialog*Button.highlightBackground \
+ systemDialogBackgroundActive widgetDefault
}
frame $w.bot
@@ -122,6 +125,7 @@ proc ::tk_dialog {w title text bitmap default args} {
if {$tmp eq "ok" || $tmp eq "cancel"} {
grid columnconfigure $w.bot $i -minsize [expr {59 + 20}]
}
+ grid configure $w.button$i -pady 7
}
incr i
}
diff --git a/library/tearoff.tcl b/library/tearoff.tcl
index 053ebd9..70440ab 100644
--- a/library/tearoff.tcl
+++ b/library/tearoff.tcl
@@ -2,7 +2,7 @@
#
# This file contains procedures that implement tear-off menus.
#
-# RCS: @(#) $Id: tearoff.tcl,v 1.7.4.1 2006/01/25 18:21:41 dgp Exp $
+# RCS: @(#) $Id: tearoff.tcl,v 1.7.4.2 2007/04/29 02:24:49 das Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -37,6 +37,12 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} {
}
if {$y == 0} {
set y [winfo rooty $w]
+ if {[tk windowingsystem] eq "aqua"} {
+ # Shift by height of tearoff entry minus height of window titlebar
+ catch {incr y [expr {[$w yposition 1] - 16}]}
+ # Avoid the native menu bar which sits on top of everything.
+ if {$y < 22} { set y 22 }
+ }
}
set parent [winfo parent $w]
diff --git a/library/tk.tcl b/library/tk.tcl
index 2abd90f..f656e9a 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -3,7 +3,7 @@
# Initialization script normally executed in the interpreter for each
# Tk-based application. Arranges class bindings for widgets.
#
-# RCS: @(#) $Id: tk.tcl,v 1.46.2.6 2006/09/25 17:28:20 andreas_kupries Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.46.2.7 2007/04/29 02:24:49 das Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -123,9 +123,9 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
} elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} {
set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}]
}
- if {$windowingsystem eq "macintosh" || $windowingsystem eq "aqua"} {
+ if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} {
# Avoid the native menu bar which sits on top of everything.
- if {$y < 20} { set y 20 }
+ if {$y < 22} { set y 22 }
}
}
wm geometry $w +$x+$y