1tooltip(n)                    Tooltip management                    tooltip(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       tooltip - Tooltip management
9

SYNOPSIS

11       package require Tcl  8.4
12
13       package require msgcat  1.3
14
15       package require tooltip  ?1.4.4?
16
17       ::tooltip::tooltip command ?options?
18
19       ::tooltip::tooltip pathName ?option arg? message
20
21_________________________________________________________________
22

DESCRIPTION

24       This  package  provides  tooltips, small text messages that can be dis‐
25       played when the mouse hovers over a widget,  menu  item,  canvas  item,
26       listbox item or text widget tag.
27

COMMANDS

29       ::tooltip::tooltip command ?options?
30              Manage the tooltip package using the following subcommands.
31
32              clear index
33                     Prevents  the  specified  widgets  from showing tooltips.
34                     pattern is a glob pattern and defaults  to  matching  all
35                     widgets.
36
37              delay ?millisecs?
38                     Query  or  set the hover delay. This is the interval that
39                     the pointer  must  remain  over  the  widget  before  the
40                     tooltip is displayed. The delay is specified in millisec‐
41                     onds and must be greater than 50ms.  With no argument the
42                     current delay is returned.
43
44              fade ?boolean?
45                     Enable  or disable fading of the tooltip.  The is enabled
46                     by default on Win32 and Aqua.  The tooltip will fade away
47                     on Leave events instead disappearing.
48
49              disable
50
51              off    Disable all tooltips
52
53              enable
54
55              on     Enables tooltips for defined widgets.
56
57
58       ::tooltip::tooltip pathName ?option arg? message
59              This  command  arranges for widget pathName to display a tooltip
60              with message message.  The tooltip uses  a  late-binding  msgcat
61              call  on  the passed in message to allow for on-the-fly language
62              changes in an application.  If the widget specified is  a  menu,
63              canvas  or  text  widget then additional options are used to tie
64              the tooltip to specific menu entries, canvas items or text tags.
65
66              -index index
67                     This option is used to set a tooltip on a menu item.  The
68                     index  may  be either the entry index or the entry label.
69                     The widget must be a menu widget but the entries  do  not
70                     have to exists when the tooltip is set.
71
72              -items name
73                     This option is used to set a tooltip for canvas widget or
74                     listbox items.  For the  canvas  widget,  the  item  must
75                     already be present in the canvas widget and will be found
76                     with a find withtag  lookup.   For  listbox  widgets  the
77                     item(s)  may  be  created  later  but  the  programmer is
78                     responsible for managing the  link  between  the  listbox
79                     item  index and the corresponding tooltip. If the listbox
80                     items are re-ordered, the tooltips will need amending.
81
82                     If the widget is not a canvas or listbox then an error is
83                     raised.
84
85              -tag name
86                     The  -tag  option can be used to set a tooltip for a text
87                     widget tag. The tag should already be present  when  this
88                     command  is called or an error will be returned. The wid‐
89                     get must also be a text widget.
90

EXAMPLE

92       # Demonstrate widget tooltip
93       package require tooltip
94       pack [label .l -text "label"]
95       tooltip::tooltip .l "This is a label widget"
96
97
98       # Demonstrate menu tooltip
99       package require tooltip
100       tooltip::tooltip .menu.test -index 0 "This is a menu tooltip"
101
102
103       # Demonstrate canvas item tooltip
104       package require tooltip
105       pack [canvas .c]
106       set item [.c create rectangle 10 10 80 80]
107       tooltip::tooltip .c -item $item "Canvas item tooltip"
108
109
110       # Demonstrate listbox item tooltip
111       package require tooltip
112       pack [listbox .lb]
113       tooltip::tooltip .lb -item 0 "Listbox item tooltip"
114
115
116       # Demonstrate text tag tooltip
117       package require tooltip
118       pack [text .txt]
119       tooltip::tooltip .txt -tag TIP-1 "tooltip one text"
120
121

KEYWORDS

123       balloon, help, hover, tooltip
124
126       Copyright (c) 1996-2008, Jeffrey Hobbs
127
128
129
130
131tooltip                              1.4.4                          tooltip(n)
Impressum