tooltip - Tooltip management
This package provides tooltips, small text messages that can be displayed when the mouse hovers over a widget, menu item, canvas item, listbox item or text widget tag.
Manage the tooltip package using the following subcommands.
This command arranges for widget pathName to display a tooltip with message message. The tooltip uses a late-binding msgcat call on the passed in message to allow for on-the-fly language changes in an application. If the widget specified is a menu, canvas or text widget then additional options are used to tie the tooltip to specific menu entries, canvas items or text tags.
# Demonstrate widget tooltip package require tooltip pack [label .l -text "label"] tooltip::tooltip .l "This is a label widget"
# Demonstrate menu tooltip package require tooltip . configure -menu [menu .menu] .menu add cascade -label Test -menu [menu .menu.test -tearoff 0] .menu.test add command -label Tooltip tooltip::tooltip .menu.test -index 0 "This is a menu tooltip"
# Demonstrate canvas item tooltip package require tooltip pack [canvas .c] set item [.c create rectangle 10 10 80 80] tooltip::tooltip .c -item $item "Canvas item tooltip"
# Demonstrate listbox item tooltip package require tooltip pack [listbox .lb] .lb insert 0 "item one" tooltip::tooltip .lb -item 0 "Listbox item tooltip"
# Demonstrate text tag tooltip package require tooltip pack [text .txt] .txt tag configure TIP-1 -underline 1 tooltip::tooltip .txt -tag TIP-1 "tooltip one text" .txt insert end "An example of a " {} "tooltip" TIP-1 " tag.\n" {}
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tooltip of the Tklib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.
Copyright © 1996-2008, Jeffrey Hobbs