当前位置: 首页>>代码示例>>Python>>正文


Python Label.applySkin方法代码示例

本文整理汇总了Python中Components.Label.Label.applySkin方法的典型用法代码示例。如果您正苦于以下问题:Python Label.applySkin方法的具体用法?Python Label.applySkin怎么用?Python Label.applySkin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Components.Label.Label的用法示例。


在下文中一共展示了Label.applySkin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: applySkin

# 需要导入模块: from Components.Label import Label [as 别名]
# 或者: from Components.Label.Label import applySkin [as 别名]
    def applySkin(self, desktop, parent):
        # testInstance = self.GUI_WIDGET(parent)
        testInstance = self.testInstance
        testInstance.hide()
        testSkinAttributes = []
        if self.skinAttributes:
            for (attrib, value) in self.skinAttributes:
                if attrib == 'size':
                    x, y = value.split(',')
                    x = '2000'
                    new_value = x + ',' + y
                    testSkinAttributes.append((attrib, new_value))
                else:
                    testSkinAttributes.append((attrib, value))
            skin.applyAllAttributes(testInstance, desktop, testSkinAttributes, parent.scale)
        Label.applySkin(self, desktop, parent)
        maxWidth = self.instance.size().width()

        # some random text
        text = 'DSADJASNKDNSJANDJKSANDJKSANDNASJKNDSJKANDJKSANDJKAS'
        text += 'FDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFSDFDSFDS'
        text += 'FDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFSDFDSFDS'
        text += 'FDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFDSFSDFDSFDS'

        testInstance.setText(text)
        actWidth = testInstance.calculateSize().width()
        pixsPerChar = float(actWidth) / float(len(text))
        print actWidth, '/', len(text), '=', pixsPerChar
        print maxWidth
        if pixsPerChar > 0:
            self.maxChars = int(maxWidth / pixsPerChar)
        print self.maxChars
开发者ID:easyspider,项目名称:archivczsk,代码行数:34,代码来源:common.py

示例2: applySkin

# 需要导入模块: from Components.Label import Label [as 别名]
# 或者: from Components.Label.Label import applySkin [as 别名]
	def applySkin(self, desktop, screen):
		if self.skinAttributes is not None:
			attribs = []
			append = attribs.append
			for attrib, value in self.skinAttributes:
				if attrib == "displayLength":
					self.displayLength = int(value)
				else:
					append((attrib, value))
			self.skinAttributes = attribs
		return Label.applySkin(self, desktop, screen)
开发者ID:Haehnchen,项目名称:enigma2-plugins,代码行数:13,代码来源:RSSTickerView.py


注:本文中的Components.Label.Label.applySkin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。