1from gi.repository import Gtk
2import sys
3
4
5class MyWindow(Gtk.ApplicationWindow):
6    # a window
7
8    def __init__(self, app):
9        Gtk.Window.__init__(self, title="GNOME LinkButton", application=app)
10        self.set_default_size(250, 50)
11
12        # a linkbutton pointing to the given URI
13        button = Gtk.LinkButton(uri="http://live.gnome.org")
14        # with given text
15        button.set_label("Link to GNOME live!")
16
17        # add the button to the window
18        self.add(button)
19
20
21class MyApplication(Gtk.Application):
22
23    def __init__(self):
24        Gtk.Application.__init__(self)
25
26    def do_activate(self):
27        win = MyWindow(self)
28        win.show_all()
29
30    def do_startup(self):
31        Gtk.Application.do_startup(self)
32
33app = MyApplication()
34exit_status = app.run(sys.argv)
35sys.exit(exit_status)
36