Discussion:
[Tkinter-discuss] Hint text
Charles Hixson
2011-12-29 05:11:20 UTC
Permalink
Is there any way to show hints on mouseovers that doesn't require
writing a separate function for each, e.g., Radiobutton?

The only thing I've seen documentation say changes on mouseovers is the
state, and the documentation says it will call the command whenever the
state changes...but I don't see any way to tell what is having it's
state changed except by having different commands for each selection.
--
Charles Hixson
Michael Lange
2011-12-29 10:46:30 UTC
Permalink
Hi Charles,

Thus spoketh Charles Hixson <charleshixsn at earthlink.net>
Post by Charles Hixson
Is there any way to show hints on mouseovers that doesn't require
writing a separate function for each, e.g., Radiobutton?
The only thing I've seen documentation say changes on mouseovers is the
state, and the documentation says it will call the command whenever the
state changes...but I don't see any way to tell what is having it's
state changed except by having different commands for each selection.
unfortunately there is no such thing built into Tk by default, so you
will have to stick with some extra module. The good news is that there
are plenty of those available ready to use.
If installing the Pmw package is an option for you, you might want to
have a look at the Pmw.Ballon class:

http://pmw.sourceforge.net/doc/Balloon.html

I think Tix has a ballon widget either, but I haven't used Tix for a
couple of years, so I'm not exactly sure ;)

If you have IDLE already installed you can use its ToolTip class, like
Post by Charles Hixson
from Tkinter import *
from idlelib import ToolTip
b=Button(text='foo')
b.pack()
ToolTip.ToolTip(b, 'bla')
In case you don't want to install IDLE, there is also a modified version
of IDLE's ToolTip available as a stand-alone module at:
http://tkinter.unpy.net/wiki/ToolTip

I hope this helps

Michael


.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

We Klingons believe as you do -- the sick should die. Only the strong
should live.
-- Kras, "Friday's Child", stardate 3497.2
python
2011-12-29 11:40:34 UTC
Permalink
Hi Charles,

There are many modules that add tooltip functionality to Tkinter; google
tooltip tkinter for a list.

One of my favorite tooltip modules is:
http://code.activestate.com/recipes/576688-tooltip-for-tkinter/

If you research this topic in more depth, let us know what module you
end up using.

Malcolm
Cameron Laird
2011-12-29 21:07:53 UTC
Permalink
On Thu, Dec 29, 2011 at 06:40:34AM -0500, python at bdurham.com wrote:
.
.
.
Post by python
There are many modules that add tooltip functionality to Tkinter; google
tooltip tkinter for a list.
http://code.activestate.com/recipes/576688-tooltip-for-tkinter/
If you research this topic in more depth, let us know what module you
end up using.
.
.
.
More to read, on the same subject: <URL: http://wiki.tcl.tk/10551 >.
Loading...