Skip to content

LinkLabel

RedFantom edited this page Jul 7, 2017 · 1 revision

The LinkLabel widget is a widget that offers the option to open a hyperlink when clicked in the default browser of the system it's running on.

Reference

Using a LinkLabel is not much different from using a normal Label widget. It just has a few more options you can use to set-up its link properties. This can be done by passing keyword arguments at initialization, or you can use the normal Widget functions to change it while your program is running (cget, configure, __getitem__ and __setitem__).

These additonal options are available:

  • link

    A str variable that contains the link to open when the LinkLabel is clicked.

  • normal_color

    A valid Tkinter color name in str type for the text color in the LinkLabel.

  • hover_color

    A valid Tkinter color name in str type for the text color in the LinkLabel while the mouse is hovering over the LinkLabel.

  • clicked_color

    A valid Tkinter color name in str type for the text color in the LinkLabel while the mouse is not hovering but the LinkLabel has been clicked at least once.

These additional functions are available:

  • reset(self)

    Resets the visited count (and thus normal_color is shown again as text color if the LinkLabel had been clicked).

Clone this wiki locally