File: linkbutton.py

package info (click to toggle)
pygobject 3.55.3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,728 kB
  • sloc: ansic: 39,419; python: 26,856; sh: 114; makefile: 81; xml: 35; cpp: 1
file content (23 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gi

gi.require_version("Gtk", "4.0")
from gi.repository import Gtk


class LinkButtonWindow(Gtk.ApplicationWindow):
    def __init__(self, **kargs):
        super().__init__(**kargs, title="LinkButton Demo")

        button = Gtk.LinkButton(uri="https://www.gtk.org", label="Visit GTK Homepage")
        self.set_child(button)


def on_activate(app):
    win = LinkButtonWindow(application=app)
    win.present()


app = Gtk.Application(application_id="com.example.App")
app.connect("activate", on_activate)

app.run(None)