Browse Source

closes #404 - clickable hyperlinks in console

pull/473/head
Chris 5 years ago
parent
commit
3313cb86a6
2 changed files with 7 additions and 1 deletions
  1. 6
      gooey/gui/components/console.py
  2. 2
      gooey/gui/components/widgets/basictextconsole.py

6
gooey/gui/components/console.py

@ -1,3 +1,5 @@
import webbrowser
import wx
from gooey.gui.lang import i18n
@ -34,6 +36,10 @@ class Console(wx.Panel):
self.layoutComponent()
self.Layout()
self.Bind(wx.EVT_TEXT_URL, self.followUrl, self.textbox)
def followUrl(self, event):
webbrowser.open(self.textbox.GetValue()[event.URLStart:event.URLEnd])
def getFontStyle(self):

2
gooey/gui/components/widgets/basictextconsole.py

@ -2,4 +2,4 @@ import wx
class BasicTextConsole(wx.TextCtrl):
def __init__(self, parent):
super(BasicTextConsole, self).__init__(parent, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH)
super(BasicTextConsole, self).__init__(parent, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH | wx.TE_AUTO_URL )
Loading…
Cancel
Save