summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordas <das@noemail.net>2007-04-29 02:24:23 (GMT)
committerdas <das@noemail.net>2007-04-29 02:24:23 (GMT)
commitfe26e8b7df1aa86151897e1ad51e31b995a296f5 (patch)
treef20546aa88feed6dd0e9fd7f5202cdccd4003006 /library
parent75cf69c5bb553f8544f519c80e86846b6cbaf9d2 (diff)
downloadtk-fe26e8b7df1aa86151897e1ad51e31b995a296f5.zip
tk-fe26e8b7df1aa86151897e1ad51e31b995a296f5.tar.gz
tk-fe26e8b7df1aa86151897e1ad51e31b995a296f5.tar.bz2
* library/demos/menu.tcl: on aqua, use custom MDEF and tearoffs;
* library/demos/menubu.tcl: correct menubutton toplevel name. * library/demos/puzzle.tcl: fix button size & padding for aqua. FossilOrigin-Name: e44116b981ac8a8429a7cb211bc420227088891c
Diffstat (limited to 'library')
-rw-r--r--library/demos/menu.tcl11
-rw-r--r--library/demos/menubu.tcl11
-rw-r--r--library/demos/puzzle.tcl6
3 files changed, 16 insertions, 12 deletions
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index 4464e9e..9ac2809 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.2.2 2005/06/25 03:41:39 das Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.4.2.3 2007/04/29 02:24:24 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -19,7 +19,8 @@ positionWindow $w
label $w.msg -font $font -wraplength 4i -justify left
if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
- $w.msg configure -text "This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse."
+ catch {set origUseCustomMDEF $::tk::mac::useCustomMDEF; set ::tk::mac::useCustomMDEF 1}
+ $w.msg configure -text "This window has a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by selecting the first item in the menu."
} else {
$w.msg configure -text "This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu."
}
@@ -143,7 +144,7 @@ $m entryconfigure "Does almost nothing" -bitmap questhead -compound left \
set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
-menu $m
+menu $m -tearoff 1
foreach i {red orange yellow green blue} {
$m add command -label $i -background $i -command [list \
puts "You invoked \"$i\"" ]
@@ -159,3 +160,7 @@ bind Menu <<MenuSelect>> {
set menustatus $label
update idletasks
}
+
+if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
+ catch {set ::tk::mac::useCustomMDEF $origUseCustomMDEF}
+}
diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl
index bfe6e5b..f931f73 100644
--- a/library/demos/menubu.tcl
+++ b/library/demos/menubu.tcl
@@ -1,24 +1,24 @@
-# menubutton.tcl --
+# menubu.tcl --
#
# This demonstration script creates a window with a bunch of menus
# and cascaded menus using menubuttons.
#
-# # RCS: @(#) $Id: menubu.tcl,v 1.3 2002/08/31 06:12:28 das Exp $
+# # RCS: @(#) $Id: menubu.tcl,v 1.3.2.1 2007/04/29 02:24:24 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
-set w .menubutton
+set w .menubu
catch {destroy $w}
toplevel $w
wm title $w "Menu Button Demonstration"
wm iconname $w "menubutton"
positionWindow $w
-
frame $w.body
pack $w.body -expand 1 -fill both
+if {[tk windowingsystem] eq "aqua"} {catch {set origUseCustomMDEF $::tk::mac::useCustomMDEF; set ::tk::mac::useCustomMDEF 1}}
menubutton $w.body.below -text "Below" -underline 0 -direction below -menu $w.body.below.m -relief raised
menu $w.body.below.m -tearoff 0
@@ -90,5 +90,4 @@ foreach i {Black gray75 gray50 White} {
pack $body.buttons.colors -side left -padx 25 -pady 25
-
-
+if {[tk windowingsystem] eq "aqua"} {catch {set ::tk::mac::useCustomMDEF $origUseCustomMDEF}}
diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl
index fe48733..66de20c 100644
--- a/library/demos/puzzle.tcl
+++ b/library/demos/puzzle.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a 15-puzzle game using a collection
# of buttons.
#
-# RCS: @(#) $Id: puzzle.tcl,v 1.4 2002/08/31 06:12:28 das Exp $
+# RCS: @(#) $Id: puzzle.tcl,v 1.4.2.1 2007/04/29 02:24:24 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -59,8 +59,8 @@ scrollbar $w.s
# using place which doesn't autosize, then we need to have a
# slightly larger frame here...
-if {[string equal [tk windowingsystem] aqua]} {
- set frameSize 160
+if {[tk windowingsystem] eq "aqua"} {
+ set frameSize 168
} else {
set frameSize 120
}