本文整理匯總了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)