Closed avalon60 closed 1 year ago
@avalon60 button_tooltip = CTkToolTip(widget=self.button_1, message='Hello world')
it was widget not master.
@avalon60
button_tooltip = CTkToolTip(widget=self.button_1, message='Hello world')
it was widget not master.
Thanks, but I tried that and it's the same result:
@avalon60 I am not getting this error on windows. I know what's causing the issue.
@avalon60 Try removing this line having self.transient: https://github.com/Akascape/CTkToolTip/blob/d8e64cf922088e21f94e3fb083aac5eada8f98da/CTkToolTip/ctk_tooltip.py#L51
@Akascape I am on Linux Mint. Commenting out the transient line does fix the problem, thanks. Not sure whether this is relevant, but out of interest, when I hover over the line in Pycharm, I get this:
Unexpected type(s): (Misc) Possible type(s): (None) (Wm | Tcl_Obj | Tcl_Obj)
Inspection info:
Reports type errors in function call expressions, targets, and return values. In a dynamically typed language, this is possible in a limited number of cases.
Types of function parameters can be specified in docstrings or in Python 3 function annotations.
Example:
def foo() -> int:
return "abc" # Expected int, got str
a: str
a = foo() # Expected str, got int
With the quick-fix, you can modify the problematic types:
def foo() -> str:
return "abc"
a: str
a = foo()
Closed
Hi @Akascape.
There is an issue with CTKToolTip, wherein if you define override the builtin dunder methods, for example the
__str__
method, of a class, then CTkoolTip causes an exception:This code demonstrates the issue:
This causes the exception:
If I comment the tool-tip out, the program runs without error and when the button is pressed, the print statement works as expected, as we see here: