jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

appJar warning message: "ToolTips unavailable" #596

Closed projectbtle closed 4 years ago

projectbtle commented 4 years ago

Bug Report


When creating a label with a corresponding tooltip, the tooltip doesn't get displayed.

Context


Trying to display tooltips for widgets.

Expected Behaviour


A tooltip should be displayed.

Actual Behaviour


No tooltip is displayed. When running the code, the following warning message is displayed:

2019-10-01 11:56:22,800 appJar:WARNING [Line 5]: ToolTips unavailable - check tooltip.py is in the lib folder
2019-10-01 11:56:22,848 appJar:WARNING [Line 7]: ToolTips unavailable - check tooltip.py is in the lib folder

After modifying the appjar code to display any exceptions, obtained the following:

No module named 'appJar.lib'; 'appJar' is not a package

Any error messages produced by appJar


The warning messages above.

Sample code, demonstrating the issue


Got this code from a previous issue:

from appJar import gui
with gui() as app:
    app.label('hello world', tip="help me")
    app.addLabel("l1", "text")
    app.setLabelTooltip("l1", "more help")

What steps are needed to reproduce the bug


Run the above code as a standalone script.

Version Information


appJar: 0.94.0 Python: 3.7.3 TCL: 8.6, TK: 8.6 Platform: Windows

Current workaround


I added the following line to line 586 in appJar.py: self.lib_path = os.path.join(gui.lib_path, "lib") and the following to the try block within the _loadTooltip method: sys.path.append(self.lib_path)

So the method definition in my appJar.py is:

def _loadTooltip(self):
        """ loads tooltips - used all over """
        global ToolTip
        if ToolTip is None:
            try:
                sys.path.append(self.lib_path)
                from tooltip import ToolTip
            except Exception as e:
                print(str(e))
                ToolTip = False
jarvisteach commented 4 years ago

I'm not seeing any issues on Mac - I'll have to test on Windows.

Just out of interest, how did you install appJar?

jarvisteach commented 4 years ago

Actually, looks like this is a duplicate of issue #541

jarvisteach commented 4 years ago

Closing this, and will prioritise #541

projectbtle commented 4 years ago

Apologies for the delay in replying. To answer the previous question: I didn't install appJar; just added the files (including all libs) to my project.