summaryrefslogtreecommitdiffstats
path: root/doc/popup.n
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2004-06-21 20:59:29 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2004-06-21 20:59:29 (GMT)
commit949db5cca4f5a40dad96bcc5ad7ac404791aa203 (patch)
tree0c3dce93ee61bce73f9d7f290c4e4569944424ca /doc/popup.n
parenta4075f9022b2e79e80d9fb9444e1a90e46c93a66 (diff)
downloadtk-949db5cca4f5a40dad96bcc5ad7ac404791aa203.zip
tk-949db5cca4f5a40dad96bcc5ad7ac404791aa203.tar.gz
tk-949db5cca4f5a40dad96bcc5ad7ac404791aa203.tar.bz2
Fix example and add a bit more explanatory text
Diffstat (limited to 'doc/popup.n')
-rw-r--r--doc/popup.n11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/popup.n b/doc/popup.n
index 603577e..40896fd 100644
--- a/doc/popup.n
+++ b/doc/popup.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: popup.n,v 1.3 2004/06/21 20:47:02 dkf Exp $
+'\" RCS: @(#) $Id: popup.n,v 1.4 2004/06/21 20:59:29 dkf Exp $
'\"
.so man.macros
.TH tk_popup n 4.0 Tk "Tk Built-In Commands"
@@ -29,17 +29,18 @@ Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and
the menu will be positioned so that the entry is positioned over
the given point.
.SH EXAMPLE
+How to attach a simple popup menu to a widget.
.CS
# Create a menu
-menu .m
-\.m add command \-label "Example 1" \-command bell
-\.m add command \-label "Example 2" \-command bell
+set m [menu .popupMenu]
+$m add command \-label "Example 1" \-command bell
+$m add command \-label "Example 2" \-command bell
# Create something to attach it to
pack [label .l \-text "Click me!"]
# Arrange for the menu to pop up when the label is clicked
-bind .l <1> {\fBtk_popup\fR .m %X %Y}
+bind .l <1> {\fBtk_popup\fR .popupMenu %X %Y}
.CE
.SH "SEE ALSO"