2
# -*- coding: utf-8 -*-
6
__authors__ = ["Jan Jokela <janjokela@gmail.com>"]
7
__licenses__ = ["LICENSE.LGPL"]
8
__description__ = "Tests for the horizontal box widget"
13
# Change sys path to glitter path
14
glitter_path = os.path.split(sys.path[0])[0]
15
sys.path[0] = glitter_path
17
from window import Window
22
from window import Window
24
from label import Label
25
from image import Image
26
from slider import Slider
28
class TestHBox(object):
29
""" Tests for the horizontal box widget """
32
""" Initialize test """
34
self.window = Window("Glitter tests")
35
self.window.connect("destroy", self.destroy)
37
self.stage = self.window.get_stage()
38
self.stage.connect('notify::width', self.do_resize)
39
self.stage.connect('notify::height', self.do_resize)
42
self.hbox.spacing = 0.0
43
self.stage.add(self.hbox)
44
self.hbox._update_layout()
46
self.label1 = Label("LABEL")
47
self.hbox.pack(self.label1)
49
self.slider = Slider()
50
self.hbox.pack(self.slider)
51
#self.slider.v_offset = 0.1
53
self.label2 = Label("LABEL")
54
self.hbox.pack(self.label2)
56
self.window.show_all()
59
def do_resize(self, stage, event):
60
self.hbox._update_layout()
61
#print self.label1.natural_width
63
def destroy(self, widget, data=None):
67
if __name__ == '__main__':