Home > Archive > Tcl > July 2005 > tooltip from Tklin 8.4.10.0 ... doesn't appear to work with menus
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
tooltip from Tklin 8.4.10.0 ... doesn't appear to work with menus
|
|
| Lee Elms 2005-07-26, 9:05 am |
|
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 2005-07-26, 9:05 am |
| To correct my typo and be a little more precise:
tooltip from Tklib in Activestate Tcl 8.4.10.0
Lee Elms wrote:
>
> 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
| |
| Jeff Hobbs 2005-07-31, 10:03 pm |
| 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
|
|
|
|
|