Skip to content

Commit d82aa2f

Browse files
author
Tom Schimansky
committed
added error message for clipboard copying
1 parent 4c79acb commit d82aa2f

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111

1212
setup(name="tkintermapview",
13-
version="1.6",
13+
version="1.7",
1414
author="Tom Schimansky",
1515
license="Creative Commons Zero v1.0 Universal",
1616
url="https://github.com/TomSchimansky/TkinterMapView",

tkintermapview/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.6"
1+
__version__ = "1.7"
22

33
from .map_widget import TkinterMapView
44
from .offline_loading import OfflineLoader

tkintermapview/map_widget.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,15 @@ def mouse_right_click(self, event):
138138
coordinate_mouse_pos = num2deg(tile_mouse_x, tile_mouse_y, round(self.zoom))
139139

140140
def click_coordinates_event():
141-
xerox.copy(f"{coordinate_mouse_pos[0]:.7f} {coordinate_mouse_pos[1]:.7f}")
142141
try:
142+
xerox.copy(f"{coordinate_mouse_pos[0]:.7f} {coordinate_mouse_pos[1]:.7f}")
143143
tkinter.messagebox.showinfo(title="", message="Coordinates copied to clipboard!")
144+
144145
except Exception:
145-
pass
146+
if sys.platform.startswith("linux"):
147+
tkinter.messagebox.showinfo(title="", message="Error copying to clipboard.\nTry install xclip:\n'sudo apt-get install xclip'")
148+
else:
149+
tkinter.messagebox.showinfo(title="", message="Error copying to clipboard.")
146150

147151
m = tkinter.Menu(self, tearoff=0)
148152
m.add_command(label=f"{coordinate_mouse_pos[0]:.7f} {coordinate_mouse_pos[1]:.7f}",

0 commit comments

Comments
 (0)