本文整理汇总了Python中pyjamas.Window.resize方法的典型用法代码示例。如果您正苦于以下问题:Python Window.resize方法的具体用法?Python Window.resize怎么用?Python Window.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.Window
的用法示例。
在下文中一共展示了Window.resize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onTimer
# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import resize [as 别名]
def onTimer(self):
print "hello"
loc = Window.getLocation()
print loc.getHash()
print loc.getHost()
print loc.getPageHref()
print loc.getPathname()
print loc.getSearchDict()
Window.resize(300.0, 200.0)
示例2: testResize
# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import resize [as 别名]
def testResize(self):
# TODO: window resizing does not work accuratly in browser
# because getClientWidth etc does not really match GWT. We
# need to copy the GWT implementation
if IN_BROWSER:
return
self.resize_test = True
Window.addWindowResizeListener(self)
self.h = Window.getClientHeight()
self.w = Window.getClientWidth()
Window.resize(800, 600)
示例3: onWindowResized
# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import resize [as 别名]
def onWindowResized(self, width, height):
if not self.resize_test:
self.fail("onWindowResized called after WindowListener removed")
return
nh = Window.getClientHeight()
nw = Window.getClientWidth()
# TODO: we cannot assert the exact size, because, we have toolbars
self.assertTrue(nw!=self.w)
self.assertTrue(nh!=self.h)
self.assertTrue(isinstance(nw, int))
self.assertTrue(isinstance(nh, int))
# put the window back to its original size
# but make sure to switch off resize notify!
self.resize_test = False
Window.removeWindowResizeListener(self)
Window.resize(self.w, self.h)