Skip to content

Commit

Permalink
[STUDIO] Disable tkDnD when unavailable on platform
Browse files Browse the repository at this point in the history
  • Loading branch information
ObaraEmmanuel committed Aug 29, 2024
1 parent f2ef7de commit 267a0e2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion hoverset/ui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,12 @@ class Widget:
s_window = None # Static window holder
__readonly_options = {"class", "container"}

def register_drop_target(self, target):
try:
super().register_drop_target(target)
except (AttributeError, tk.TclError):
pass

def setup(self, _=None):
"""
It performs the necessary dependency injection and event bindings and
Expand Down Expand Up @@ -1459,7 +1465,10 @@ def __init__(self, *args, **kwargs):
pass

super().__init__(*args, **kwargs)
_init_tkdnd(self)
try:
_init_tkdnd(self)
except tk.TclError:
pass
self.position_ref = Screen(self)
self.bind_all("<MouseWheel>", self._on_mousewheel, '+')
# linux bindings
Expand Down

0 comments on commit 267a0e2

Please sign in to comment.