本文整理汇总了Python中frame.Frame.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.__init__方法的具体用法?Python Frame.__init__怎么用?Python Frame.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frame.Frame
的用法示例。
在下文中一共展示了Frame.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__(self, screen, game):
''' An example class to show how to creat custom GUI frames'''
Frame.__init__(self, screen, (330, 110), (10, 10))
self.game = game
self.b1 = Button(self, "Toggle Constant", self.command)
self.b2 = Button(self, "Toggle Random", self.command2, position=(5,40))
self.b3 = Button(self, "Toggle Shape", self.command3, position=(5, 75))
self.c_Label = Label(self, "False", position=(135, 10))
self.r_Label = Label(self, "True", position=(135, 45))
self.s_Label = Label(self, "Random", position=(135, 80))
self.l1 = Label(self, "Size", position=(235, 10))
self.tb1 = TextBox(self, (295, 10))
self.l2 = Label(self, "Density", position=(235, 45))
self.tb2 = TextBox(self, (295, 45))
self.l3 = Label(self, "Speed", position=(235, 80))
self.tb3 = TextBox(self, (295, 80))
self.textboxes = {'size' : self.tb1,
'density' : self.tb2,
'speed' : self.tb3}
self.current = 'circle'
示例2: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__( self, screen, x, y, width, height, vertical, frame1 ):
log.debug( "SplitFrame.__init__" )
Frame.__init__( self, screen, x, y, width, height )
self.split_dragging = False
self.vertical = vertical
if vertical:
self.split = height
else:
self.split = width
self.split = self.split >> 1
self.frame1 = frame1
if vertical:
self.frame1.moveresize( x, y, self.width, self.height - self.split )
# this is a horrible hack to get around circular importing
self.frame2 = self.frame1.topmost_child().__class__( self.screen, self.x, self.y + self.split+4,
self.width, self.height-self.split-4)
else:
self.frame1.moveresize( x, y, self.width - self.split, self.height )
self.frame2 = self.frame1.topmost_child().__class__( self.screen, self.x + self.split+4, self.y,
self.width-self.split-4, self.height)
frame1.tritium_parent.replace_me( frame1, self )
self.frame1.tritium_parent = self.frame2.tritium_parent = self
self.frame1.activate()
self.create_split_window()
示例3: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__(self, rect, font, name=None):
Frame.__init__(self, rect)
self.active = True
self.font = font
self.textcolor = BUTTONTEXTCOLOR
self.backgroundcolor = BUTTONBACKGROUNDCOLOR
self.name = name
self.textframe = None
# Margins
self.top = 1
示例4: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__(self, rect, font):
Frame.__init__(self, rect)
self.active = True
self.font = font
self.textcolor = TEXTCOLOR
self.name = None
self.lines = []
# Margins
self.top = 1
self.bottom = 1
self.left = 1
self.right = 1
示例5: next
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def next(self):
if self._closed:
raise ValueError('I/O operation on closed file')
nfi = self._nfi
if nfi < self._n_csets:
unitcell = self._nextUnitcell()
coords = self._nextCoordset()
if self._ag is None:
frame = Frame(self, nfi, coords, unitcell)
else:
frame = self._frame
Frame.__init__(frame, self, nfi, None, unitcell)
return frame
示例6: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__(self, rect, font):
Frame.__init__(self, rect)
self.active = True
self.font = font
self.textcolor = TEXTCOLOR
self.name = None
self.lines = ['']
self.char_limit = 40
self.textframe = None
# Margins
self.top = 1
self.right = 1
self.left = 1
示例7: next
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def next(self):
if self._closed:
raise ValueError('I/O operation on closed file')
nfi = self._nfi
if nfi < self._n_csets:
traj = self._trajectory
while traj._nfi == traj._n_csets:
self._nextFile()
traj = self._trajectory
unitcell = traj._nextUnitcell()
coords = traj._nextCoordset()
if self._ag is None:
frame = Frame(self, nfi, coords, unitcell)
else:
frame = self._frame
Frame.__init__(frame, self, nfi, None, unitcell)
self._ag.setACSLabel(self._title + ' frame ' + str(self._nfi))
self._nfi += 1
return frame
示例8: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__(self, root_console_width, root_console_height, frame_manager=None):
Frame.__init__(self, root_console_width, root_console_height, frame_manager)
self.text_base = root_console_width/2, root_console_height/4
self.title_text = "ROGUEP: A Game of Viruses"
self.option_one_text = "Play"
self.option_two_text = "Quit"
示例9: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import __init__ [as 别名]
def __init__( self, screen, x, y, width, height ):
log.debug( "TabbedFrame.__init__" )
Frame.__init__( self, screen, x, y, width, height )
self.tabs = Tabs( self )