mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-18 02:52:42 +03:00
Allow changing of url after creation
This commit is contained in:
1 parent
723dfd5394
commit
33f322e1ae
1 file changed
+2
-3
@@ -30,8 +30,7 @@ class HyperlinkLabel(platform == 'darwin' and tk.Label or ttk.Label, object):
|
||||
else:
|
||||
ttk.Label.__init__(self, master, **kw)
|
||||
|
||||
if self.url:
|
||||
self.bind('<Button-1>', self._click)
|
||||
self.bind('<Button-1>', self._click)
|
||||
|
||||
if self.popup_copy:
|
||||
self.menu = tk.Menu(None, tearoff=tk.FALSE)
|
||||
@@ -86,7 +85,7 @@ class HyperlinkLabel(platform == 'darwin' and tk.Label or ttk.Label, object):
|
||||
self.configure(font = self.font_n)
|
||||
|
||||
def _click(self, event):
|
||||
if self['text'] and str(self['state']) != tk.DISABLED:
|
||||
if self.url and self['text'] and str(self['state']) != tk.DISABLED:
|
||||
url = self.url(self['text']) if callable(self.url) else self.url
|
||||
if url:
|
||||
self._leave(event) # Remove underline before we change window to browser
|
||||
|
||||
Reference in new issue
Block a user