I have been trying to port my program to run on macOS.
All is OK except tkfilbrowser come up with this error.
And the gui screen does not open correctly.
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1948, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "/Users/rob/3pac/controlsrchartsSql.py", line 453, in BrowseWorkDir
charts.directory=askopendirname(initialdir=conf3pac['custfolder'],title="Select folder to download files into")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/functions.py", line 61, in askopendirname
dialog = FileBrowser(parent, mode="opendir", multiple_selection=False,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/filebrowser.py", line 333, in init
wrapper = TooltipTreeWrapper(self.left_tree)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/tooltip.py", line 86, in init
self.tooltip = Tooltip(tree, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/tooltip.py", line 47, in init
self.overrideredirect(True)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 2232, in wm_overrideredirect
return self._getboolean(self.tk.call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1504, in _getboolean
return self.tk.getboolean(string)
^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: expected boolean value but got ""
The error is related to tooltip.py and the self.overrideredirect(True) command.
If I change this to self.overrideredirect(False) all works OK.
I was thinking this change may be suitable as a fix.
Can you verify this and include in a later version.
error is line 47:
class Tooltip(tk.Toplevel):
"""Tooltip to display when the mouse stays long enough on an item."""
def init(self, parent, **kwargs):
"""
Create Tooltip.
Options:
* parent: parent window
* text: text (str) to display in the tooltip
* compound: relative orientation of the graphic relative to the text
* alpha: opacity of the tooltip (0 for transparent, 1 for opaque),
the text is affected too, so 0 would mean an invisible tooltip
"""
tk.Toplevel.__init__(self, parent)
self.transient(parent)
if platform.startswith('linux'):
self.attributes('-type', 'tooltip')
self.attributes('-alpha', kwargs.get('alpha', 0.8))
self.overrideredirect(True) <===== problem line 47.
style = kwargs.get('style', 'tooltip.tkfilebrowser.TLabel')
bg = ttk.Style(self).lookup(style, 'background')
self.configure(background=bg)
self.label = ttk.Label(self, text=kwargs.get('text', ''),
style=style, compound=kwargs.get('compound', 'left'),
padding=kwargs.get('padding', 4))
self.label.pack()
Suggested change.
class Tooltip(tk.Toplevel):
"""Tooltip to display when the mouse stays long enough on an item."""
def init(self, parent, **kwargs):
"""
Create Tooltip.
Options:
* parent: parent window
* text: text (str) to display in the tooltip
* compound: relative orientation of the graphic relative to the text
* alpha: opacity of the tooltip (0 for transparent, 1 for opaque),
the text is affected too, so 0 would mean an invisible tooltip
"""
tk.Toplevel.__init__(self, parent)
self.transient(parent)
if platform.startswith('linux'):
self.attributes('-type', 'tooltip')
self.attributes('-alpha', kwargs.get('alpha', 0.8))
if platform.startswith(darwin'):
self.overrideredirect(False)
else:
self.overrideredirect(True)
style = kwargs.get('style', 'tooltip.tkfilebrowser.TLabel')
bg = ttk.Style(self).lookup(style, 'background')
self.configure(background=bg)
self.label = ttk.Label(self, text=kwargs.get('text', ''),
style=style, compound=kwargs.get('compound', 'left'),
padding=kwargs.get('padding', 4))
self.label.pack()
I have been trying to port my program to run on macOS.
All is OK except tkfilbrowser come up with this error.
And the gui screen does not open correctly.
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1948, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "/Users/rob/3pac/controlsrchartsSql.py", line 453, in BrowseWorkDir
charts.directory=askopendirname(initialdir=conf3pac['custfolder'],title="Select folder to download files into")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/functions.py", line 61, in askopendirname
dialog = FileBrowser(parent, mode="opendir", multiple_selection=False,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/filebrowser.py", line 333, in init
wrapper = TooltipTreeWrapper(self.left_tree)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/tooltip.py", line 86, in init
self.tooltip = Tooltip(tree, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tkfilebrowser/tooltip.py", line 47, in init
self.overrideredirect(True)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 2232, in wm_overrideredirect
return self._getboolean(self.tk.call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1504, in _getboolean
return self.tk.getboolean(string)
^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: expected boolean value but got ""
The error is related to tooltip.py and the self.overrideredirect(True) command.
If I change this to self.overrideredirect(False) all works OK.
I was thinking this change may be suitable as a fix.
Can you verify this and include in a later version.
error is line 47:
class Tooltip(tk.Toplevel):
"""Tooltip to display when the mouse stays long enough on an item."""
def init(self, parent, **kwargs):
"""
Create Tooltip.
Suggested change.
class Tooltip(tk.Toplevel):
"""Tooltip to display when the mouse stays long enough on an item."""
def init(self, parent, **kwargs):
"""
Create Tooltip.