belfrywidgets icon indicating copy to clipboard operation
belfrywidgets copied to clipboard

ToolTips for ttk.Treeview elements/nodes

Open buhtz opened this issue 6 years ago • 1 comments

Do you know a way to use ToolTip on elements/nodes of a ttk.Treeview?

I tried to use tag= but this causes errors like this

  File "feedtreeview.py", line 101, in add_dev_info
    ToolTip(self, 'Tooltip', tag=iid)
  File "/usr/local/lib/python3.6/dist-packages/belfrywidgets/tooltip.py", line 21, in __init__
    self.widget.tag_bind(tag, "<Enter>", self.enter)
  File "/usr/lib/python3.6/tkinter/ttk.py", line 1467, in tag_bind
    self._bind((self._w, "tag", "bind", tagname), sequence, callback, add=0)
  File "/usr/lib/python3.6/tkinter/__init__.py", line 1203, in _bind
    self.tk.call(what + (sequence, cmd))
_tkinter.TclError: unsupported event <Enter>
only key, button, motion, and virtual events supported

buhtz avatar Apr 07 '18 23:04 buhtz

The ‘tag’ argument is only for the standard Text widget, to add tooltips for a specific text tag. I haven’t tried to use the ToolTip with ttk widgets. I’ll have to experiment.

revarbat avatar Apr 11 '18 03:04 revarbat