########################################################################
#
#  Copyright (C) 2009, CZ.NIC, z.s.p.o.
# 
#  This file is part of dnstester.
#
#  dnstester is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  dnstester is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
########################################################################

import pygtk
pygtk.require("2.0")
import gtk, gobject
import lang
import misc

class Clickable(gtk.EventBox):

    def __init__(self, tag, link):
        gtk.EventBox.__init__(self)
        self.link = link
        self.label = gtk.Label('<span color="blue"><u>' + lang.get_string(tag) + '</u></span>')
        self.label.set_use_markup(True)
        self.add(self.label)
        self.connect("button-press-event", self.on_click, None)

    def on_click(self, widget, event, data):
        misc.openurl(self.link)




