1# -*- coding: utf-8 -*- 2 3# Copyright (C) 2013 Osmo Salomaa 4# 5# This program is free software: you can redistribute it and/or modify 6# it under the terms of the GNU General Public License as published by 7# the Free Software Foundation, either version 3 of the License, or 8# (at your option) any later version. 9# 10# This program is distributed in the hope that it will be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# GNU General Public License for more details. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18import gaupol 19 20from gi.repository import Gtk 21 22 23class TestFloatingLabel(gaupol.TestCase): 24 25 def run(self): 26 self.label.flash_text("Testing floating label") 27 self.window.connect("notify::visible", Gtk.main_quit) 28 Gtk.main() 29 30 def setup_method(self, method): 31 self.window = Gtk.Window() 32 gaupol.style.load_css(self.window) 33 self.window.set_default_size(800, 480) 34 self.window.connect("delete-event", Gtk.main_quit) 35 self.overlay = Gtk.Overlay() 36 self.overlay.add(Gtk.Label()) 37 self.window.add(self.overlay) 38 self.label = gaupol.FloatingLabel() 39 self.overlay.add_overlay(self.label) 40 self.window.show_all() 41