本文整理汇总了Python中View.View.set_frame方法的典型用法代码示例。如果您正苦于以下问题:Python View.set_frame方法的具体用法?Python View.set_frame怎么用?Python View.set_frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View.View
的用法示例。
在下文中一共展示了View.set_frame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_frame
# 需要导入模块: from View import View [as 别名]
# 或者: from View.View import set_frame [as 别名]
def set_frame(self, rect):
if ( self._resizable == False
and (rect.size.width != None or rect.size.height != None)):
raise ValueError(u'Window is not resizable')
View.set_frame(self, rect)
self._pyglet.set_location(self._frame.origin.x, self._frame.origin.y)
self._pyglet.set_size(self._frame.size.width, self._frame.size.height)
示例2: __init__
# 需要导入模块: from View import View [as 别名]
# 或者: from View.View import set_frame [as 别名]
def __init__(self, style=STYLE_DEFAULT, fixed_size=None):
View.__init__(self)
self._window = self
self._first_responder = None
self._title = None
self._style = style
self._resizable = fixed_size is None
self._application = Application.shared_application()
self._min_size = None
self._max_size = None
self._zoomed = False
self._key_window = False
self._main_window = False
if fixed_size is None:
# normal window
self._pyglet = PygletWindow(self,
style=style,
resizable=True)
else:
# fixed size window
self._pyglet = PygletWindow(self,
style=style,
resizable=False,
width=fixed_size.width,
height=fixed_size.height)
x, y = self._pyglet.get_location()
width, height = self._pyglet.get_size()
View.set_frame(self, Rect(x, y, width, height))
self._application._add_window(self)
示例3: on_resize
# 需要导入模块: from View import View [as 别名]
# 或者: from View.View import set_frame [as 别名]
def on_resize(self, width, height):
pyglet.window.Window.on_resize(self, width, height)
View.set_frame(self._window, Rect(width=width, height=height))
示例4: on_move
# 需要导入模块: from View import View [as 别名]
# 或者: from View.View import set_frame [as 别名]
def on_move(self, x, y):
View.set_frame(self._window, Rect(x=x, y=y))