Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tooltip from Tklin 8.4.10.0 ... doesn't appear to work with menus

4 views
Skip to first unread message

Lee Elms

unread,
Jul 26, 2005, 8:56:52 AM7/26/05
to

package require tooltip

label .l -text "Label"
pack .l
tooltip::tooltip .l "Some 'tooltip' help"

set mb [menu .mb]
. config -menu $mb
set m [menu $mb.file]
$mb add cascade -label "File" -menu $m
$m add command -label "Save" -command {file_save}
tooltip::tooltip $m -index 0 "Save buffer contents for tab"


The tooltip appears correctly on the label, but doesn't appear for the
menu item.

Am I doing something silly, or is there a bug ?


Thanks in advance ...

-- Lee Elms

Lee Elms

unread,
Jul 26, 2005, 9:56:58 AM7/26/05
to
To correct my typo and be a little more precise:

tooltip from Tklib in Activestate Tcl 8.4.10.0

Jeff Hobbs

unread,
Jul 31, 2005, 2:13:46 PM7/31/05
to Lee Elms
Lee Elms wrote:
>
> package require tooltip
...

> set mb [menu .mb]
> . config -menu $mb
> set m [menu $mb.file]
> $mb add cascade -label "File" -menu $m
> $m add command -label "Save" -command {file_save}
> tooltip::tooltip $m -index 0 "Save buffer contents for tab"
>
> The tooltip appears correctly on the label, but doesn't appear for the
> menu item.
>
> Am I doing something silly, or is there a bug ?

There is a bug, but in both the above and the code. The
menus always have a tearoff by default, which is index 0.
The bug in the tooltip code only relates to the usage of
index 0, as it happens, at least on Windows. The problem
is that the posting of the menu already triggers the 0
index, even though you aren't over it yet. There is a
last index check because Windows continuously generates
the MenuSelect event as you motion over any menu (even the
same index).

--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos

0 new messages