Commit | Line | Data |
---|---|---|
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" | |
134 | Tk::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 | |
172 | balloons to various widgets so that when the mouse pauses over the | |
173 | widget for more than a specified amount of time, a help balloon is | |
174 | popped up. | |
175 | .Sh "Balloons and Menus" | |
176 | .IX Subsection "Balloons and Menus" | |
177 | If the balloon is attached to a \fBMenu\fR widget and the message arguments | |
178 | are array references, then each element in the array will be the | |
179 | message corresponding to a menu entry. The balloon message will then | |
180 | be shown for the entry which the mouse pauses over. Otherwise it is | |
181 | assumed that the balloon is to be attached to the \fBMenu\fR as a whole. | |
182 | You can have separate status and balloon messages just like normal | |
183 | balloons. | |
184 | .Sh "Balloons and Canvases" | |
185 | .IX Subsection "Balloons and Canvases" | |
186 | If the balloon is attached to a \fBCanvas\fR widget and the message | |
187 | arguments are hash references, then each hash key should correspond to | |
188 | a canvas item \s-1ID\s0 or tag and the associated value will correspond to the | |
189 | message for that canvas item. The balloon message will then be shown for | |
190 | the current item (the one at the position of the mouse). Otherwise it is | |
191 | assumed that the balloon is to be attached to the \fBCanvas\fR as a whole. | |
192 | You can have separate status and balloon messages just like normal | |
193 | balloons. | |
194 | .SH "OPTIONS" | |
195 | .IX Header "OPTIONS" | |
196 | \&\fBBalloon\fR accepts all of the options that the \fBFrame\fR widget | |
197 | accepts. In addition, the following options are also recognized. | |
198 | .IP "\fB\-initwait\fR" 4 | |
199 | .IX Item "-initwait" | |
200 | Specifies the amount of time to wait without activity before | |
201 | popping up a help balloon. Specified in milliseconds. Defaults to | |
202 | 350 milliseconds. This applies to both the popped up balloon and | |
203 | the status bar message. | |
204 | .IP "\fB\-state\fR" 4 | |
205 | .IX Item "-state" | |
206 | Can be one of \fB'balloon'\fR, \fB'status'\fR, \fB'both'\fR or \fB'none'\fR | |
207 | indicating that the help balloon, status bar help, both or none | |
208 | respectively should be activated when the mouse pauses over the | |
209 | client widget. Default is \fB'both'\fR. | |
210 | .IP "\fB\-statusbar\fR" 4 | |
211 | .IX Item "-statusbar" | |
212 | Specifies the widget used to display the status message. This | |
213 | widget should accept the \fB\-text\fR option and is typically a | |
214 | \&\fBLabel\fR. If the widget accepts the \fB\-textvariable\fR option and | |
215 | that option is defined then it is used instead of the \fB\-text\fR | |
216 | option. | |
217 | .IP "\fB\-balloonposition\fR" 4 | |
218 | .IX Item "-balloonposition" | |
219 | Can be one of \fB'widget'\fR or \fB'mouse'\fR. It controls where the balloon | |
220 | will popup. \fB'widget'\fR makes the balloon appear at the lower right | |
221 | corner of the widget it is attached to (default), and \fB'mouse'\fR makes | |
222 | the balloon appear below and to the right of the current mouse position. | |
223 | .IP "\fB\-postcommand\fR" 4 | |
224 | .IX Item "-postcommand" | |
225 | This option takes a \fB\s-1CODE\s0\fR reference which will be executed before the | |
226 | balloon and statusbar messages are displayed and should return a true | |
227 | or false value to indicate whether you want the balloon to be displayed | |
228 | or not. This also lets you control where the balloon is positioned by | |
229 | returning a true value that looks like \fIX,Y\fR (matches this regular | |
230 | expression: \f(CW\*(C`/^(\ed+),(\ed+)$/\*(C'\fR). If the postcommand returns a value that | |
231 | matches that re then those coordinates will be used as the position to | |
232 | post the balloon. \fIWarning:\fR this subroutine should return quickly or | |
233 | the balloon response will appear slow. | |
234 | .IP "\fB\-cancelcommand\fR" 4 | |
235 | .IX Item "-cancelcommand" | |
236 | This option takes a \fB\s-1CODE\s0\fR reference which will be executed before the | |
237 | balloon and statusbar messages are canceled and should return a true | |
238 | or false value to indicate whether you want the balloon to be canceled | |
239 | or not. \fIWarning:\fR this subroutine should return quickly or the balloon | |
240 | response will appear slow. | |
241 | .IP "\fB\-motioncommand\fR" 4 | |
242 | .IX Item "-motioncommand" | |
243 | This option takes a \fB\s-1CODE\s0\fR reference which will be executed for any | |
244 | motion event and should return a true or false value to indicate | |
245 | whether the currently displayed balloon should be canceled (deactivated). | |
246 | If it returns true then the balloon will definitely be canceled, if it | |
247 | returns 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 | |
249 | interval, use the \fB\-postcommand\fR option to control that behavior. | |
250 | \&\fIWarning:\fR the subroutine should be extremely fast or the balloon | |
251 | response will appear slow and consume a lot of \s-1CPU\s0 time (it is executed | |
252 | every time the mouse moves over the widgets the balloon is attached to). | |
253 | .SH "METHODS" | |
254 | .IX Header "METHODS" | |
255 | The \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)" | |
258 | Attaches the widget indicated by \fIwidget\fR to the help system. The | |
259 | allowed options are: | |
260 | .IP "\fB\-statusmsg\fR" 4 | |
261 | .IX Item "-statusmsg" | |
262 | The argument is the message to be shown on the status bar when the | |
263 | mouse pauses over this client. If this is not specified, but | |
264 | \&\fB\-msg\fR is specified then the message displayed on the status bar | |
265 | is the same as the argument for \fB\-msg\fR. If you give it a scalar | |
266 | reference then it is dereferenced before being displayed. Useful | |
267 | if the postcommand is used to change the message. | |
268 | .IP "\fB\-balloonmsg\fR" 4 | |
269 | .IX Item "-balloonmsg" | |
270 | The argument is the message to be displayed in the balloon that | |
271 | will 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 | |
273 | from the \fB\-msg\fR specification if any. If neither \fB\-balloonmsg\fR | |
274 | nor \fB\-msg\fR are specified, or they are the empty string then | |
275 | no balloon is popped up instead of an empty balloon. If you | |
276 | give it a scalar reference then it is dereferenced before being | |
277 | displayed. Useful if the postcommand is used to change the message. | |
278 | .IP "\fB\-msg\fR" 4 | |
279 | .IX Item "-msg" | |
280 | The catch-all for \fB\-statusmsg\fR and \fB\-balloonmsg\fR. This is a | |
281 | convenient way of specifying the same message to be displayed in | |
282 | both 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 | |
299 | These options allow you to override the balloon's default value for | |
300 | those option for some of the widgets it is attached to. It accepts the | |
301 | same 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)" | |
304 | Detaches the specified \fIwidget\fR from the help system. | |
305 | .Sh "\fBdestroy\fP" | |
306 | .IX Subsection "destroy" | |
307 | Destroys the specified balloon. | |
308 | .SH "EXAMPLES" | |
309 | .IX Header "EXAMPLES" | |
310 | See the balloon demo included with the widget demo script that came with | |
311 | the distribution for examples on various ways to use balloons. | |
312 | .SH "NOTES" | |
313 | .IX Header "NOTES" | |
314 | Because of the overhead associated with each balloon you create (from | |
315 | tracking the mouse movement to know when to activate and deactivate | |
316 | them) you will see the best performance (low \s-1CPU\s0 consumption) if you | |
317 | create as few balloons as possible and attach them to as many widgets | |
318 | as you can. In other words, don't create a balloon for each widget | |
319 | you want to attach one to. | |
320 | .SH "CAVEATS" | |
321 | .IX Header "CAVEATS" | |
322 | Pressing any button will deactivate (cancel) the current balloon, | |
323 | if one exists. You can usually make the balloon reappear by moving | |
324 | the mouse a little. Creative use of the 3 command options can help | |
325 | you out also. If the mouse is over the balloon when a menu is unposted | |
326 | then the balloon will remain until you move off of it. | |
327 | .SH "BUGS" | |
328 | .IX Header "BUGS" | |
329 | Hopefully 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 | |
335 | other enhancements. | |
336 | .PP | |
337 | \&\fBSlaven Rezic\fR <eserte@cs.tu\-berlin.de> added support for canvas items. | |
338 | .SH "HISTORY" | |
339 | .IX Header "HISTORY" | |
340 | The code and documentation was derived from Balloon.tcl from the | |
341 | Tix4.0 distribution by Ioi Lam and modified by the above mentioned | |
342 | authors. This code may be redistributed under the same terms as Perl. |