Closed atannen closed 4 months ago
Tooltip has default kwargs, for now it is just the aspect
, see.
If you override the defaults you are responsible for providing aspect
, which I think is somewhat reasonable.
How would you suggest allowing for overridable defaults through kwargs?
You have:
self.message_kwargs: dict = message_kwargs or self.DEFAULT_MESSAGE_KWARGS
Instead I would expect to see:
self.message_kwargs = self.DEFAULT_MESSAGE_KWARGS.copy()
self.message_kwargs.update(message_kwargs)
That's a substantially better solution thanks @dmd, will fix now
Just issued v3.1.0, you should be able to grab the changes there.
The following code makes a button and attaches a tooltip.
1) without the bg= line, it wraps the tooltip balloon text properly. 2) with the bg= and fg= line, (without aspect=) it wraps wrong. (Commu newline nity.) 3) with bg= fg= and aspect=1000, it wraps properly again.
It looks like the apsect value is getting trashed or ignored when bg and fg are set. I don't know whether this is intended behavior, but I found it confusing.
This on Ubuntu 22.04 with Python 3.10.12 and tktooltip from pip: Name: tkinter-tooltip Version: 3.0.0