summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-01-18 11:50:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-01-18 11:50:59 (GMT)
commite7249b0e543558e314e2d597b711312eb67dc365 (patch)
tree3aa47da8d809cb22fe93a4f813a49b5ef325516a
parent866ef3643c493059ad2275e21192c0cea5d0073c (diff)
downloadtk-e7249b0e543558e314e2d597b711312eb67dc365.zip
tk-e7249b0e543558e314e2d597b711312eb67dc365.tar.gz
tk-e7249b0e543558e314e2d597b711312eb67dc365.tar.bz2
Fix widget parenting issue reported by Keith Nash. Also tidied up a bit.
-rw-r--r--ChangeLog6
-rw-r--r--library/demos/menu.tcl32
2 files changed, 23 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 47a6a87..d295e09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/menu.tcl: Reworked to make dialogs children of the
+ demo widget so that they are properly visible. Issue reported by
+ Keith Nash <k.j.nash@usa.net>
+
2005-01-14 Joe English <jenglish@users.sourceforge.net>
* unix/tkUnixWm.c: Sync with CVS HEAD (r1.47):
Fixes: #959973 "wm title bug" (support Unicode titles)
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index 9352d73..3eb3c44 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a window with a bunch of menus
# and cascaded menus using menubars.
#
-# RCS: @(#) $Id: menu.tcl,v 1.4 2002/08/31 06:12:28 das Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.4.2.1 2005/01/18 11:51:04 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -116,14 +116,15 @@ $m invoke 7
set m $w.menu.icon
$w.menu add cascade -label "Icons" -menu $m -underline 0
menu $m -tearoff 0
-$m add command \
- -bitmap @[file join $tk_library demos images pattern.bmp] \
- -hidemargin 1 \
- -command {
- tk_dialog .pattern {Bitmap Menu Entry} {The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.} {} 0 OK
-}
+$m add command -bitmap @[file join $tk_library demos images pattern.bmp] \
+ -hidemargin 1 -command [list \
+ tk_dialog $w.pattern {Bitmap Menu Entry} \
+ "The menu entry you invoked displays a bitmap rather than\
+ a text string. Other than this, it is just like any other\
+ menu entry." {} 0 OK ]
foreach i {info questhead error} {
- $m add command -bitmap $i -command "puts {You invoked the $i bitmap}" -hidemargin 1
+ $m add command -bitmap $i -hidemargin 1 -command [list \
+ puts "You invoked the $i bitmap" ]
}
$m entryconfigure 2 -columnbreak 1
@@ -133,19 +134,20 @@ menu $m -tearoff 0
foreach i {{An entry} {Another entry} {Does nothing} {Does almost nothing} {Make life meaningful}} {
$m add command -label $i -command [list puts "You invoked \"$i\""]
}
-$m entryconfigure "Does almost nothing" \
- -bitmap questhead -compound left -command {
- tk_dialog .compound {Compound Menu Entry} {The menu entry you invoked\
- displays both a bitmap and a text string. Other than this, it\
- is just like any other menu entry.} {} 0 OK
+$m entryconfigure "Does almost nothing" -bitmap questhead -compound left \
+ -command [list \
+ tk_dialog $w.compound {Compound Menu Entry} \
+ "The menu entry you invoked displays both a bitmap and a\
+ text string. Other than this, it is just like any other\
+ menu entry." {} 0 OK ]
}
set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
menu $m
foreach i {red orange yellow green blue} {
- $m add command -label $i -background $i \
- -command [list puts "You invoked \"$i\""]
+ $m add command -label $i -background $i -command [list \
+ puts "You invoked \"$i\"" ]
}
$w configure -menu $w.menu