Last active
December 17, 2022 08:32
-
-
Save timlau/9b866ab6defd788c59eeb2121a9ba4ed to your computer and use it in GitHub Desktop.
Gtk4 - Label with Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gi | |
gi.require_version("Gtk", "4.0") | |
from gi.repository import Gtk # noqa | |
def on_activate(app): | |
win = Gtk.ApplicationWindow( | |
application=app, title="Gtk4 is Awesome !!!", default_height=200, default_width=400 | |
) | |
label = Gtk.Label() | |
link = '<a href="https://fosstodon.org/@nerdytim">This is a Link to my Mastodon</a>' | |
label.set_markup(link) | |
win.set_child(label) | |
win.present() | |
app = Gtk.Application(application_id="org.gtk.Example") | |
app.connect("activate", on_activate) | |
app.run(None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment