summaryrefslogtreecommitdiffstats
path: root/doc/popup.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-28 12:25:22 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-28 12:25:22 (GMT)
commiteb4d4cfa5dd31037346933200186c9e52409a2f8 (patch)
treeb0f115441846677d2289359c4cfc2c067a621eb5 /doc/popup.n
parent6ff31223f9e947f2e8a9330e494b1c16708ab112 (diff)
downloadtk-eb4d4cfa5dd31037346933200186c9e52409a2f8.zip
tk-eb4d4cfa5dd31037346933200186c9e52409a2f8.tar.gz
tk-eb4d4cfa5dd31037346933200186c9e52409a2f8.tar.bz2
More backporting of doc fixes
Diffstat (limited to 'doc/popup.n')
-rw-r--r--doc/popup.n19
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/popup.n b/doc/popup.n
index a1b49bd..2fb37d9 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.2 1998/09/14 18:22:59 stanton Exp $
+'\" RCS: @(#) $Id: popup.n,v 1.2.26.1 2004/10/28 12:25:22 dkf Exp $
'\"
.so man.macros
.TH tk_popup n 4.0 Tk "Tk Built-In Commands"
@@ -28,6 +28,23 @@ menu's upper left corner is positioned at the given point.
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
+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 .popupMenu %X %Y}
+.CE
+
+.SH "SEE ALSO"
+bind(n), menu(n), tk_optionMenu(n)
.SH KEYWORDS
menu, popup