@@ -0,0 +1,2639 @@
+#!/usr/bin/env python%0A# -*- Mode: Python; py-indent-offset: 4 -*-%0A# vim: tabstop=4 shiftwidth=4 expandtab%0A#%0A# Copyright (C) 2010 Red Hat, Inc., John (J5) Palmieri %3Cjohnp@redhat.com%3E%0A#%0A# This library is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU Lesser General Public%0A# License as published by the Free Software Foundation; either%0A# version 2.1 of the License, or (at your option) any later version.%0A#%0A# This library is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A# Lesser General Public License for more details.%0A#%0A# You should have received a copy of the GNU Lesser General Public%0A# License along with this library; if not, write to the Free Software%0A# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0A# USA%0A%0Atitle = %22Links%22%0Adescription = %22%22%22%0AGtkLabel can show hyperlinks. The default action is to call gtk_show_uri() on %0Atheir URI, but it is possible to override this with a custom handler.%0A%22%22%22%0A%0Afrom gi.repository import Gtk%0A%0Aclass LinksApp:%0A    def __init__(self):%0A        self.window = Gtk.Window()%0A        self.window.set_title('Links')%0A        self.window.set_border_width(12)%0A        self.window.connect('destroy', Gtk.main_quit)%0A%0A        label = Gtk.Label(%22%22%22Some %3Ca href=%22http://en.wikipedia.org/wiki/Text%22%0Atitle=%22plain text%22%3Etext%3C/a%3E may be marked up%0Aas hyperlinks, which can be clicked%0Aor activated via %3Ca href=%22keynav%22%3Ekeynav%3C/a%3E%22%22%22)%0A%0A        label.set_use_markup(True)%0A        label.connect(%22activate-link%22, self.activate_link)%0A        self.window.add(label);%0A        label.show()%0A%0A        self.window.show()%0A%0A    def activate_link(self, label, uri):%0A        if uri == 'keynav':%0A            parent = label.get_toplevel()%0A            markup = %22%22%22The term %3Ci%3Ekeynav%3C/i%3E is a shorthand for%0Akeyboard navigation and refers to the process of using%0Aa program (exclusively) via keyboard input.%22%22%22%0A            dialog = Gtk.MessageDialog(parent,%0A                                       Gtk.DialogFlags.DESTROY_WITH_PARENT,%0A                                       Gtk.MessageType.INFO,%0A                                       Gtk.ButtonsType.OK,%0A                                       text=markup,%0A                                       use_markup=True)%0A            dialog.present()%0A            dialog.connect('response', self.response_cb)%0A%0A            return True%0A%0A    def response_cb(self, dialog, response_id):%0A        dialog.destroy()%0A%0Adef main(demoapp=None):%0A    app = LinksApp()%0A    Gtk.main()%0A%0Aif __name__ == '__main__':%0A    main()%0A

add the links demo