mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Allow changing of url after creation
This commit is contained in:
parent
723dfd5394
commit
33f322e1ae
@ -30,8 +30,7 @@ class HyperlinkLabel(platform == 'darwin' and tk.Label or ttk.Label, object):
|
|||||||
else:
|
else:
|
||||||
ttk.Label.__init__(self, master, **kw)
|
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:
|
if self.popup_copy:
|
||||||
self.menu = tk.Menu(None, tearoff=tk.FALSE)
|
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)
|
self.configure(font = self.font_n)
|
||||||
|
|
||||||
def _click(self, event):
|
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
|
url = self.url(self['text']) if callable(self.url) else self.url
|
||||||
if url:
|
if url:
|
||||||
self._leave(event) # Remove underline before we change window to browser
|
self._leave(event) # Remove underline before we change window to browser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user