summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2007-05-30 06:34:18 (GMT)
committerdas <das>2007-05-30 06:34:18 (GMT)
commiteea3d8a589c007592691cf767336a06b0f600c50 (patch)
tree7f71d977d1684d7ab7abab1184b5b9882d32d329
parentedeaa5c2c7150918146c96bac23523101fed2e8c (diff)
downloadtk-eea3d8a589c007592691cf767336a06b0f600c50.zip
tk-eea3d8a589c007592691cf767336a06b0f600c50.tar.gz
tk-eea3d8a589c007592691cf767336a06b0f600c50.tar.bz2
* library/bgerror.tcl: standardize dialog option & button size
* library/dialog.tcl: modifications done when running on on Aqua. * library/msgbox.tcl: * library/demos/button.tcl: set button highlightbackground on Aqua.
-rw-r--r--library/bgerror.tcl6
-rw-r--r--library/demos/button.tcl5
-rw-r--r--library/dialog.tcl15
-rw-r--r--library/msgbox.tcl17
4 files changed, 31 insertions, 12 deletions
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index dcece7e..0879a71 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.33 2007/04/23 21:16:43 das Exp $
-# $Id: bgerror.tcl,v 1.33 2007/04/23 21:16:43 das Exp $
+# RCS: @(#) $Id: bgerror.tcl,v 1.34 2007/05/30 06:34:18 das Exp $
+# $Id: bgerror.tcl,v 1.34 2007/05/30 06:34:18 das Exp $
namespace eval ::tk::dialog::error {
namespace import -force ::tk::msgcat::*
@@ -225,7 +225,7 @@ proc ::tk::dialog::error::bgerror err {
# We boost the size of some Mac buttons for l&f
if {$windowingsystem eq "aqua"} {
if {($name eq "ok") || ($name eq "dismiss")} {
- grid columnconfigure .bgerrorDialog.bot $i -minsize 79
+ grid columnconfigure .bgerrorDialog.bot $i -minsize 90
}
grid configure .bgerrorDialog.$name -pady 7
}
diff --git a/library/demos/button.tcl b/library/demos/button.tcl
index c13fbbd..2578e4f 100644
--- a/library/demos/button.tcl
+++ b/library/demos/button.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a toplevel window containing
# several button widgets.
#
-# RCS: @(#) $Id: button.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
+# RCS: @(#) $Id: button.tcl,v 1.5 2007/05/30 06:34:18 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -28,6 +28,9 @@ pack $btns -side bottom -fill x
proc colorrefresh {w col} {
$w configure -bg $col
$w.buttons configure -bg $col
+ if {[tk windowingsystem] eq "aqua"} {
+ $w.buttons configure -highlightbackground $col
+ }
}
button $w.b1 -text "Peach Puff" -width 10 \
diff --git a/library/dialog.tcl b/library/dialog.tcl
index 44b89ec..0623b89 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.21 2007/04/23 21:16:43 das Exp $
+# RCS: @(#) $Id: dialog.tcl,v 1.22 2007/05/30 06:34:18 das Exp $
#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -45,6 +45,13 @@ proc ::tk_dialog {w title text bitmap default args} {
set default [lsearch -exact $args $default]
}
+ set windowingsystem [tk windowingsystem]
+ if {$windowingsystem eq "aqua"} {
+ option add *Dialog*background systemDialogBackgroundActive widgetDefault
+ option add *Dialog*Button.highlightBackground \
+ systemDialogBackgroundActive widgetDefault
+ }
+
# 1. Create the top-level window and divide it into top
# and bottom parts.
@@ -65,12 +72,8 @@ proc ::tk_dialog {w title text bitmap default args} {
wm transient $w [winfo toplevel [winfo parent $w]]
}
- set windowingsystem [tk windowingsystem]
if {$windowingsystem eq "aqua"} {
::tk::unsupported::MacWindowStyle style $w moveableModal {}
- option add *Dialog*background systemDialogBackgroundActive widgetDefault
- option add *Dialog*Button.highlightBackground \
- systemDialogBackgroundActive widgetDefault
}
frame $w.bot
@@ -121,7 +124,7 @@ proc ::tk_dialog {w title text bitmap default args} {
if {$windowingsystem eq "aqua"} {
set tmp [string tolower $but]
if {$tmp eq "ok" || $tmp eq "cancel"} {
- grid columnconfigure $w.bot $i -minsize [expr {59 + 20}]
+ grid columnconfigure $w.bot $i -minsize 90
}
grid configure $w.button$i -pady 7
}
diff --git a/library/msgbox.tcl b/library/msgbox.tcl
index 3d8c62d..d2980d7 100644
--- a/library/msgbox.tcl
+++ b/library/msgbox.tcl
@@ -3,7 +3,7 @@
# Implements messageboxes for platforms that do not have native
# messagebox support.
#
-# RCS: @(#) $Id: msgbox.tcl,v 1.30 2006/01/25 18:22:04 dgp Exp $
+# RCS: @(#) $Id: msgbox.tcl,v 1.31 2007/05/30 06:34:18 das Exp $
#
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
#
@@ -165,6 +165,9 @@ proc ::tk::MessageBox {args} {
"warning" {set data(-icon) "caution"}
"info" {set data(-icon) "note"}
}
+ option add *Dialog*background systemDialogBackgroundActive widgetDefault
+ option add *Dialog*Button.highlightBackground \
+ systemDialogBackgroundActive widgetDefault
}
if {![winfo exists $data(-parent)]} {
@@ -264,7 +267,7 @@ proc ::tk::MessageBox {args} {
}
if {$windowingsystem eq "aqua"} {
- unsupported::MacWindowStyle style $w dBoxProc
+ ::tk::unsupported::MacWindowStyle style $w moveableModal {}
}
frame $w.bot -background $bg
@@ -368,6 +371,16 @@ proc ::tk::MessageBox {args} {
}
grid $w.$name -in $w.bot -row 0 -column $i -padx 3m -pady 2m -sticky ew
grid columnconfigure $w.bot $i -uniform buttons
+ # We boost the size of some Mac buttons for l&f
+ if {$windowingsystem eq "aqua"} {
+ set tmp [string tolower $name]
+ if {$tmp eq "ok" || $tmp eq "cancel" || $tmp eq "yes" ||
+ $tmp eq "no" || $tmp eq "abort" || $tmp eq "retry" ||
+ $tmp eq "ignore"} {
+ grid columnconfigure $w.bot $i -minsize 90
+ }
+ grid configure $w.$name -pady 7
+ }
incr i
# create the binding for the key accelerator, based on the underline