当前位置: 首页>>代码示例>>Python>>正文


Python Frame.__init__方法代码示例

本文整理汇总了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'
开发者ID:CCareaga,项目名称:Pygame-Examples,代码行数:29,代码来源:attributesGUI.py

示例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()
开发者ID:cyberlis,项目名称:tritium,代码行数:32,代码来源:split.py

示例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
开发者ID:djrahl,项目名称:ultimos,代码行数:13,代码来源:button.py

示例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
开发者ID:djrahl,项目名称:ultimos,代码行数:15,代码来源:textframe.py

示例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
开发者ID:anindita85,项目名称:ProDy,代码行数:16,代码来源:dcdfile.py

示例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
开发者ID:djrahl,项目名称:ultimos,代码行数:16,代码来源:typeframe.py

示例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
开发者ID:gokceneraslan,项目名称:ProDy,代码行数:23,代码来源:trajectory.py

示例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"
开发者ID:RCIX,项目名称:RogueP,代码行数:8,代码来源:frame_main_menu.py

示例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 )
开发者ID:cyberlis,项目名称:tritium,代码行数:6,代码来源:tabbed.py


注:本文中的frame.Frame.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。