summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
Diffstat (limited to 'library/demos')
-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
}