Inheritance diagram for wx.HyperlinkCtrl:
This class shows a static text element which links to an URL. Appearance and behaviour is completely customizable. In fact, when the user clicks on the hyperlink, a wx.HyperlinkEvent is sent but if that event is not handled (or it’s skipped; see wx.Event.Skip), then a call to wx.LaunchDefaultBrowser is done with the hyperlink’s URL.
Note
Note that standard wx.Window functions like SetBackgroundColour, SetFont, SetCursor, SetLabel can be used to customize appearance of the hyperlink.
See also
Window Style | Description |
---|---|
wx.HL_ALIGN_LEFT | Align the text to the left. |
wx.HL_ALIGN_RIGHT | Align the text to the right. |
wx.HL_ALIGN_CENTRE | Center the text (horizontally). |
wx.HL_CONTEXTMENU | Pop up a context menu when the hyperlink is right-clicked. The context menu contains a “Copy URL” menu item which is automatically handled by the hyperlink and which just copies in the clipboard the URL (not the label) of the control. |
wx.HL_DEFAULT_STYLE | The default style for wx.HyperlinkCtrl: wx.NO_BORDER | wx.HL_CONTEXTMENU | wx.HL_ALIGN_CENTRE. |
Event Name | Description |
---|---|
wx.EVT_HYPERLINK(id, func) | The hyperlink was (left) clicked. If this event is not handled in user’s code (or it’s skipped; see wx.Event.Skip), then a call to wx.LaunchDefaultBrowser is done with the hyperlink’s URL. |
A static text control that emulates a hyperlink. The link is displayed in an appropriate text style, derived from the control’s normal font. When the mouse rolls over the link, the cursor changes to a hand and the link’s color changes to the active color.
Clicking on the link does not launch a web browser; instead, a wx.HyperlinkEvent is fired.
Use the wx.EVT_HYPERLINK event binding to catch link events.
Parameters:
Returns:
Returns the colour used to print the label of the hyperlink when the mouse is over the control.
Returns:
Returns the colour used to print the label when the link has never been clicked before (i.e. the link has not been visited) and the mouse is not over the control.
Returns:
Returns the URL associated with the hyperlink.
Returns:
string
Returns True if the hyperlink has already been clicked by the user at least one time.
Returns:
bool
Returns the colour used to print the label when the mouse is not over the control and the link has already been clicked before (i.e. the link has been visited).
Returns:
Sets the colour used to print the label of the hyperlink when the mouse is over the control.
Parameters:
Sets the colour used to print the label when the link has never been clicked before (i.e. the link has not been visited) and the mouse is not over the control.
Parameters:
Sets the URL associated with the hyperlink.
Parameters:
Marks the hyperlink as visited.
Parameters:
See also