summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-08-22 22:44:14 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-08-22 22:44:14 (GMT)
commit692965d98c95bc29633660474c8fc34b3abbd092 (patch)
tree9660f5070a3ea6ce4ce829240ff9bf16c2e1fe1e /library
parent96371ea01bec52dfda6c5451136e4e4af7d9bd5e (diff)
downloadtk-692965d98c95bc29633660474c8fc34b3abbd092.zip
tk-692965d98c95bc29633660474c8fc34b3abbd092.tar.gz
tk-692965d98c95bc29633660474c8fc34b3abbd092.tar.bz2
Brought tk_messageBox demo into line with the newer look-and-feel for the demos.
Diffstat (limited to 'library')
-rw-r--r--library/demos/msgbox.tcl13
-rw-r--r--library/demos/widget13
2 files changed, 13 insertions, 13 deletions
diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl
index 4af68dc..837205a 100644
--- a/library/demos/msgbox.tcl
+++ b/library/demos/msgbox.tcl
@@ -2,7 +2,7 @@
#
# This demonstration script creates message boxes of various type
#
-# RCS: @(#) $Id: msgbox.tcl,v 1.2 1998/09/14 18:23:29 stanton Exp $
+# RCS: @(#) $Id: msgbox.tcl,v 1.3 2003/08/22 22:44:15 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -18,13 +18,10 @@ positionWindow $w
label $w.msg -font $font -wraplength 4i -justify left -text "Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box."
pack $w.msg -side top
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-button $w.buttons.vars -text "Message Box" \
- -command "showMessageBox $w"
-pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1
+pack [addSeeDismiss $w.buttons $w {} {
+ button $w.buttons.vars -text "Message Box" -command "showMessageBox $w"
+}] -side bottom -fill x
+#pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1
frame $w.left
frame $w.right
diff --git a/library/demos/widget b/library/demos/widget
index 6183745..f0ad7a7 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -11,7 +11,7 @@ exec wish "$0" "$@"
# ".tcl" files is this directory, which are sourced by this script
# as needed.
#
-# RCS: @(#) $Id: widget,v 1.14 2003/08/21 00:02:56 hobbs Exp $
+# RCS: @(#) $Id: widget,v 1.15 2003/08/22 22:44:15 dkf Exp $
eval destroy [winfo child .]
package require msgcat
@@ -310,7 +310,7 @@ focus .s
# Arguments:
# w - The name of the frame to use.
-proc addSeeDismiss {w show {vars {}}} {
+proc addSeeDismiss {w show {vars {}} {extra {}}} {
## See Code / Dismiss buttons
frame $w
frame $w.sep -height 2 -relief sunken -bd 2
@@ -321,14 +321,17 @@ proc addSeeDismiss {w show {vars {}}} {
button $w.code -text [mc "See Code"] \
-image ::img::view -compound left \
-command [list showCode $show]
+ set buttons [list x $w.code $w.dismiss]
if {[llength $vars]} {
button $w.vars -text [mc "See Variables"] \
-image ::img::view -compound left \
-command [concat [list showVars $w.dialog] $vars]
- grid x $w.vars $w.code $w.dismiss -padx 4 -pady 4
- } else {
- grid x $w.code $w.dismiss -padx 4 -pady 4
+ set buttons [linsert $buttons 1 $w.vars]
+ }
+ if {$extra ne ""} {
+ set buttons [linsert $buttons 1 [uplevel 1 $extra]]
}
+ eval grid $buttons -padx 4 -pady 4
grid columnconfigure $w 0 -weight 1
return $w
}