Ejemplo n.º 1
0
    def testCustomMediaDir(self):
        root = self.loadEmptyScene()

        pwdPath = os.path.dirname(os.path.realpath(__file__))
        mediaPath = os.path.join(pwdPath, "media")
        skin = widget.Skin("SimpleSkin.xml", mediaPath)
        downBmpPath = skin.textButtonCfg[None]['downBmp'].getName()
        upBmpPath = skin.textButtonCfg[None]['upBmp'].getName()
        self.assert_(downBmpPath == os.path.join(mediaPath, 'button_bg_down.png'))
        self.assert_(upBmpPath == os.path.join(mediaPath, 'button_bg_up.png'))

        customSkinMediaPath = os.path.join(mediaPath, 'incompleteSkinMedia')
        skin = widget.Skin("IncompleteSkin.xml", customSkinMediaPath)
        self.node = widget.ScrollBar(orientation=widget.Orientation.HORIZONTAL, 
                pos=(20,5), width=100, parent=root, skinObj=skin)
        self.start(False, ())
Ejemplo n.º 2
0
 def testScrollAreaCustomSkin(self):
     root = self.loadEmptyScene()
     image = avg.ImageNode(href="rgb24-64x64.png", size=(200, 400))
     pwdPath = os.path.dirname(os.path.realpath(__file__))
     mediaPath = os.path.join(pwdPath, "media")
     skin = widget.Skin("CustomSkin.xml", mediaPath)
     self.node = widget.ScrollArea(contentNode=image, size=(80, 80), skinObj=skin,
             parent=root)
     self.start(False,
             (lambda: self.compareImage("testScrollArea3"),))