Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

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

Visto 4 veces
Saltar al primer mensaje no leído

Lee Elms

no leída,
26 jul 2005, 8:56:5226/7/05
a

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

no leída,
26 jul 2005, 9:56:5826/7/05
a
To correct my typo and be a little more precise:

tooltip from Tklib in Activestate Tcl 8.4.10.0

Jeff Hobbs

no leída,
31 jul 2005, 14:13:4631/7/05
a 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 mensajes nuevos