how load url from richTextCtrl

Sorry but I searched on google and I’m tired but I have not found how to load the url when I click on the link that I have in my richtextctrl:

self.rtc.BeginStyle(urlStyle)

self.rtc.BeginURL(“http://www.sqliteroot.com”)

self.rtc.WriteText(“www.sqliteroot.com”)

self.rtc.EndURL();

self.rtc.EndStyle();

self.rtc.Bind(wx.EVT_TEXT_URL, self.OnURL)

self.rtc.GetCaret().Hide()

def OnURL(self, evt):

url = evt.GetString()

?? how load url

Thanks in advance.

···


Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com

That depends on what you want to happen. If you just want to launch the system browser and open it there then look at the webbrowser module in the Python library or wx.LaunchDefaultBrowser.

···

On 2/17/12 2:44 PM, Fabio Spadaro wrote:

Sorry but I searched on google and I'm tired but I have not found how to
load the url when I click on the link that I have in my richtextctrl:

         ...
         self.rtc.BeginStyle(urlStyle)
         self.rtc.BeginURL("http://www.sqliteroot.com")
         self.rtc.WriteText("www.sqliteroot.com
<http://www.sqliteroot.com>")
         self.rtc.EndURL();
         self.rtc.EndStyle();

         self.rtc.Bind(wx.EVT_TEXT_URL, self.OnURL)

         self.rtc.GetCaret().Hide()

     def OnURL(self, evt):
         url = evt.GetString()
         # ?? how load url

--
Robin Dunn
Software Craftsman