HyperLinkCtrl
is a control for wxPython that acts like a hyper link
in a typical browser.
HyperLinkCtrl
is a control for wxPython that acts like a hyper link
in a typical browser. Latest features include the ability to capture
your own left, middle, and right click events to perform your own
custom event handling and ability to open link in a new or current
browser window.
Special thanks to Robin Dunn for the event binder for the 3 mouse buttons.
Usage example:
import wx
import wx.lib.agw.hyperlink as hl
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, "HyperLink Demo")
panel = wx.Panel(self, -1)
# Default Web links:
hyper1 = hl.HyperLinkCtrl(panel, -1, "wxPython Main Page", pos=(100, 100),
URL="http://www.wxpython.org/")
# Web link with underline rollovers, opens in same window
hyper2 = hl.HyperLinkCtrl(panel, -1, "My Home Page", pos=(100, 150),
URL="http://xoomer.virgilio.it/infinity77/")
hyper2.AutoBrowse(False)
hyper2.SetColours("BLUE", "BLUE", "BLUE")
hyper2.EnableRollover(True)
hyper2.SetUnderlines(False, False, True)
hyper2.SetBold(True)
hyper2.OpenInSameWindow(True)
hyper2.SetToolTip(wx.ToolTip("Hello World!"))
hyper2.UpdateLink()
# our normal wxApp-derived class, as usual
app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
No particular window styles are available for this class.
This class processes the following events:
Event Name | Description |
---|---|
EVT_HYPERLINK_LEFT |
Responds to a left mouse button event. Sent when the left mouse button is clicked, but only if AutoBrowse is set to False . |
EVT_HYPERLINK_MIDDLE |
Responds to a middle mouse button event. Sent when the middle mouse button is clicked. |
EVT_HYPERLINK_RIGHT |
Handles a right mouse button event. Sent when the right mouse button is clicked, but only if DoPopup is set to False . |
HyperLinkCtrl
is distributed under the wxPython license.
Latest Revision: Andrea Gavana @ 16 Jul 2012, 15.00 GMT
Version 0.7
HyperLinkCtrl |
HyperLinkCtrl is a control for wxPython that acts like a hyper |
HyperLinkEvent |
Event object sent in response to clicking on a HyperLinkCtrl . |