Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Balloon.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "BALLOON 1"
132.TH BALLOON 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::Balloon \- pop up help balloons.
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 3
138\& use Tk::Balloon;
139\& ...
140\& $b = $top->Balloon(-statusbar => $status_bar_widget);
141.Ve
142.PP
143.Vb 4
144\& # Normal Balloon:
145\& $b->attach($widget,
146\& -balloonmsg => "Balloon help message",
147\& -statusmsg => "Status bar message");
148.Ve
149.PP
150.Vb 7
151\& # Balloon attached to entries in a menu widget:
152\& $b->attach($menu, -state => 'status',
153\& -msg => ['first menu entry',
154\& 'second menu entry',
155\& ...
156\& ],
157\& );
158.Ve
159.PP
160.Vb 7
161\& # Balloon attached to individual items in a canvas widget:
162\& $b->attach($canvas, -balloonposition => 'mouse',
163\& -msg => {'item1' => 'msg1',
164\& 'tag2' => 'msg2',
165\& ...
166\& },
167\& );
168.Ve
169.SH "DESCRIPTION"
170.IX Header "DESCRIPTION"
171\&\fBBalloon\fR provides the framework to create and attach help
172balloons to various widgets so that when the mouse pauses over the
173widget for more than a specified amount of time, a help balloon is
174popped up.
175.Sh "Balloons and Menus"
176.IX Subsection "Balloons and Menus"
177If the balloon is attached to a \fBMenu\fR widget and the message arguments
178are array references, then each element in the array will be the
179message corresponding to a menu entry. The balloon message will then
180be shown for the entry which the mouse pauses over. Otherwise it is
181assumed that the balloon is to be attached to the \fBMenu\fR as a whole.
182You can have separate status and balloon messages just like normal
183balloons.
184.Sh "Balloons and Canvases"
185.IX Subsection "Balloons and Canvases"
186If the balloon is attached to a \fBCanvas\fR widget and the message
187arguments are hash references, then each hash key should correspond to
188a canvas item \s-1ID\s0 or tag and the associated value will correspond to the
189message for that canvas item. The balloon message will then be shown for
190the current item (the one at the position of the mouse). Otherwise it is
191assumed that the balloon is to be attached to the \fBCanvas\fR as a whole.
192You can have separate status and balloon messages just like normal
193balloons.
194.SH "OPTIONS"
195.IX Header "OPTIONS"
196\&\fBBalloon\fR accepts all of the options that the \fBFrame\fR widget
197accepts. In addition, the following options are also recognized.
198.IP "\fB\-initwait\fR" 4
199.IX Item "-initwait"
200Specifies the amount of time to wait without activity before
201popping up a help balloon. Specified in milliseconds. Defaults to
202350 milliseconds. This applies to both the popped up balloon and
203the status bar message.
204.IP "\fB\-state\fR" 4
205.IX Item "-state"
206Can be one of \fB'balloon'\fR, \fB'status'\fR, \fB'both'\fR or \fB'none'\fR
207indicating that the help balloon, status bar help, both or none
208respectively should be activated when the mouse pauses over the
209client widget. Default is \fB'both'\fR.
210.IP "\fB\-statusbar\fR" 4
211.IX Item "-statusbar"
212Specifies the widget used to display the status message. This
213widget should accept the \fB\-text\fR option and is typically a
214\&\fBLabel\fR. If the widget accepts the \fB\-textvariable\fR option and
215that option is defined then it is used instead of the \fB\-text\fR
216option.
217.IP "\fB\-balloonposition\fR" 4
218.IX Item "-balloonposition"
219Can be one of \fB'widget'\fR or \fB'mouse'\fR. It controls where the balloon
220will popup. \fB'widget'\fR makes the balloon appear at the lower right
221corner of the widget it is attached to (default), and \fB'mouse'\fR makes
222the balloon appear below and to the right of the current mouse position.
223.IP "\fB\-postcommand\fR" 4
224.IX Item "-postcommand"
225This option takes a \fB\s-1CODE\s0\fR reference which will be executed before the
226balloon and statusbar messages are displayed and should return a true
227or false value to indicate whether you want the balloon to be displayed
228or not. This also lets you control where the balloon is positioned by
229returning a true value that looks like \fIX,Y\fR (matches this regular
230expression: \f(CW\*(C`/^(\ed+),(\ed+)$/\*(C'\fR). If the postcommand returns a value that
231matches that re then those coordinates will be used as the position to
232post the balloon. \fIWarning:\fR this subroutine should return quickly or
233the balloon response will appear slow.
234.IP "\fB\-cancelcommand\fR" 4
235.IX Item "-cancelcommand"
236This option takes a \fB\s-1CODE\s0\fR reference which will be executed before the
237balloon and statusbar messages are canceled and should return a true
238or false value to indicate whether you want the balloon to be canceled
239or not. \fIWarning:\fR this subroutine should return quickly or the balloon
240response will appear slow.
241.IP "\fB\-motioncommand\fR" 4
242.IX Item "-motioncommand"
243This option takes a \fB\s-1CODE\s0\fR reference which will be executed for any
244motion event and should return a true or false value to indicate
245whether the currently displayed balloon should be canceled (deactivated).
246If it returns true then the balloon will definitely be canceled, if it
247returns false then it may still be canceled depending the internal rules.
248\&\fINote:\fR a new balloon may be posted after the \fB\-initwait\fR time
249interval, use the \fB\-postcommand\fR option to control that behavior.
250\&\fIWarning:\fR the subroutine should be extremely fast or the balloon
251response will appear slow and consume a lot of \s-1CPU\s0 time (it is executed
252every time the mouse moves over the widgets the balloon is attached to).
253.SH "METHODS"
254.IX Header "METHODS"
255The \fBBalloon\fR widget supports only three non-standard methods:
256.Sh "\fBattach(\fP\fIwidget\fP, \fIoptions\fP\fB)\fP"
257.IX Subsection "attach(widget, options)"
258Attaches the widget indicated by \fIwidget\fR to the help system. The
259allowed options are:
260.IP "\fB\-statusmsg\fR" 4
261.IX Item "-statusmsg"
262The argument is the message to be shown on the status bar when the
263mouse pauses over this client. If this is not specified, but
264\&\fB\-msg\fR is specified then the message displayed on the status bar
265is the same as the argument for \fB\-msg\fR. If you give it a scalar
266reference then it is dereferenced before being displayed. Useful
267if the postcommand is used to change the message.
268.IP "\fB\-balloonmsg\fR" 4
269.IX Item "-balloonmsg"
270The argument is the message to be displayed in the balloon that
271will be popped up when the mouse pauses over this client. As with
272\&\fB\-statusmsg\fR if this is not specified, then it takes its value
273from the \fB\-msg\fR specification if any. If neither \fB\-balloonmsg\fR
274nor \fB\-msg\fR are specified, or they are the empty string then
275no balloon is popped up instead of an empty balloon. If you
276give it a scalar reference then it is dereferenced before being
277displayed. Useful if the postcommand is used to change the message.
278.IP "\fB\-msg\fR" 4
279.IX Item "-msg"
280The catch-all for \fB\-statusmsg\fR and \fB\-balloonmsg\fR. This is a
281convenient way of specifying the same message to be displayed in
282both the balloon and the status bar for the client.
283.IP "\fB\-initwait\fR" 4
284.IX Item "-initwait"
285.PD 0
286.IP "\fB\-state\fR" 4
287.IX Item "-state"
288.IP "\fB\-statusbar\fR" 4
289.IX Item "-statusbar"
290.IP "\fB\-balloonposition\fR" 4
291.IX Item "-balloonposition"
292.IP "\fB\-postcommand\fR" 4
293.IX Item "-postcommand"
294.IP "\fB\-cancelcommand\fR" 4
295.IX Item "-cancelcommand"
296.IP "\fB\-motioncommand\fR" 4
297.IX Item "-motioncommand"
298.PD
299These options allow you to override the balloon's default value for
300those option for some of the widgets it is attached to. It accepts the
301same values as above and will default to the \fBBalloon\fR's value.
302.Sh "\fBdetach(\fP\fIwidget\fP\fB)\fP"
303.IX Subsection "detach(widget)"
304Detaches the specified \fIwidget\fR from the help system.
305.Sh "\fBdestroy\fP"
306.IX Subsection "destroy"
307Destroys the specified balloon.
308.SH "EXAMPLES"
309.IX Header "EXAMPLES"
310See the balloon demo included with the widget demo script that came with
311the distribution for examples on various ways to use balloons.
312.SH "NOTES"
313.IX Header "NOTES"
314Because of the overhead associated with each balloon you create (from
315tracking the mouse movement to know when to activate and deactivate
316them) you will see the best performance (low \s-1CPU\s0 consumption) if you
317create as few balloons as possible and attach them to as many widgets
318as you can. In other words, don't create a balloon for each widget
319you want to attach one to.
320.SH "CAVEATS"
321.IX Header "CAVEATS"
322Pressing any button will deactivate (cancel) the current balloon,
323if one exists. You can usually make the balloon reappear by moving
324the mouse a little. Creative use of the 3 command options can help
325you out also. If the mouse is over the balloon when a menu is unposted
326then the balloon will remain until you move off of it.
327.SH "BUGS"
328.IX Header "BUGS"
329Hopefully none, probably some.
330.SH "AUTHORS"
331.IX Header "AUTHORS"
332\&\fBRajappa Iyer\fR rsi@earthling.net did the original coding.
333.PP
334\&\fBJason A. Smith\fR <smithj4@rpi.edu> added support for menus and made some
335other enhancements.
336.PP
337\&\fBSlaven Rezic\fR <eserte@cs.tu\-berlin.de> added support for canvas items.
338.SH "HISTORY"
339.IX Header "HISTORY"
340The code and documentation was derived from Balloon.tcl from the
341Tix4.0 distribution by Ioi Lam and modified by the above mentioned
342authors. This code may be redistributed under the same terms as Perl.