2_label.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # Simple window - Just a simple window
  4. # Copyright (c) 2016 Jorge Maldonado Ventura
  5. #
  6. # This file is part of Simple window
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. import gi
  19. gi.require_version('Gtk', '3.0')
  20. from gi.repository import Gtk
  21. class Window(Gtk.Window):
  22. def __init__(self):
  23. Gtk.Window.__init__(self, title='Título original')
  24. label = Gtk.Label()
  25. label.set_markup('Visita mi <a href="http://www.freakspot.net"><i>sitio web</i></a>. Texto en <b>negrita</b>.\nUn salto de línea.')
  26. self.add(label)
  27. label.set_selectable(True)
  28. if __name__ == '__main__':
  29. win = Window()
  30. win.connect('delete-event', Gtk.main_quit)
  31. win.show_all()
  32. Gtk.main()