Akascape / CTkToolTip

Small pop-up widget for displaying details inside customtkinter. (extension/add-on)
Creative Commons Zero v1.0 Universal
111 stars 7 forks source link

does not work with treeview #15

Closed DanielVieira326 closed 4 months ago

DanielVieira326 commented 1 year ago

Code:

self.tree.bind("", self.Show_desc)

def Show_desc(self,event):#tree.bind("", Show_desc) self.y = self.tree.identify_row(event.y) self.x = self.tree.identify_column(event.x) self.prevalues=self.tree.item(self.y) self.values=self.prevalues['values'] if self.x =="#2": self.tip_row=CTkToolTip(self.tree.identify_row(event.y), message=f"{self.values[1]}") if self.x =="#4": self.tip_row=CTkToolTip(self.tree.identify_row(event.y), message=f"{self.values[3]}")

Error:

File "c:\Users\daniel.vieira\Desktop\AiUni\App\app\Faturamento\Fat_import.py", line 665, in Show_desc self.tip_row=CTkToolTip(self.tree.identify_row(event.y), message=f"{self.values[3]}") File "C:\Users\daniel.vieira\Anaconda3\lib\site-packages\CTkToolTip\ctk_tooltip.py", line 42, in init self.transparent_color = self.widget._apply_appearance_mode( AttributeError: 'str' object has no attribute '_apply_appearance_mode'

Akascape commented 1 year ago

@DanielVieira326 CTkTooltip is only for customtkinter widgets and will not work with tkinter ones (like treeview). For tkinter widgets you can use this tooltip: https://github.com/gnikit/tkinter-tooltip