本文整理汇总了Python中pyjamas.ui.FocusWidget.FocusWidget.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Python FocusWidget.setWidth方法的具体用法?Python FocusWidget.setWidth怎么用?Python FocusWidget.setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.FocusWidget.FocusWidget
的用法示例。
在下文中一共展示了FocusWidget.setWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setPixelWidth
# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import setWidth [as 别名]
def setPixelWidth(self, width):
"""
Sets the CSS width in pixels for the canvas.
@param width width of the canvas in pixels
"""
width = int(width)
self.pixelWidth = width
FocusWidget.setWidth(self, width)
DOM.setElemAttribute(self.canvas, "width", str(width))
self._set_base_transform()
示例2: setPixelWidth
# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import setWidth [as 别名]
def setPixelWidth(self, width):
width = int(width)
self.pixelWidth = width
FocusWidget.setWidth(self, width)
DOM.setElemAttribute(self.canvas, "width", str(width))
self._set_base_transform()
示例3: setWidth
# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import setWidth [as 别名]
def setWidth(self, width):
FocusWidget.setWidth(self, width)
self.canvas.width = width
示例4: setPixelWidth
# 需要导入模块: from pyjamas.ui.FocusWidget import FocusWidget [as 别名]
# 或者: from pyjamas.ui.FocusWidget.FocusWidget import setWidth [as 别名]
def setPixelWidth(self, width):
FocusWidget.setWidth(self, str(width) + "px")
self.impl.setPixelWidth(self.getCanvasElement(), width)