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


Python Grid.__init__方法代码示例

本文整理汇总了Python中pyjamas.ui.Grid.Grid.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.__init__方法的具体用法?Python Grid.__init__怎么用?Python Grid.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.ui.Grid.Grid的用法示例。


在下文中一共展示了Grid.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
    def __init__(self, query, nUsers, tabName, popup, preparePanel, topPanel):
        Grid.__init__(self, 3, 2)
        self.tweet = text.TextAreaFocusHighlight(
            Text="Tickery query %r has %d results. See them at" % (
                query, nUsers),
            VisibleLines=3, MaxLength=1000, StyleName='large-query-area')
        self.tweet.addKeyboardListener(self)
        self.query = query
        self.tabName = tabName
        self.popup = popup
        self.preparePanel = preparePanel
        self.topPanel = topPanel
        self.button = Button('Tweet!', self)
        self.count = Label('')
        
        self.setWidget(0, 0, HTML(_instructions))
        self.setWidget(0, 1, self.count)
        self.setWidget(1, 0, self.tweet)
        self.setWidget(1, 1, self.button)

        formatter = self.getCellFormatter()
        formatter.setVerticalAlignment(0, 1, 'bottom')
        formatter.setVerticalAlignment(1, 1, 'bottom')
        
        self.setCount()
开发者ID:jdunck,项目名称:Tickery,代码行数:27,代码来源:tweet.py

示例2: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
    def __init__(self, grid_size):
        Grid.__init__(self)

        # populate the grid with some stuff
        #
        self.resize(grid_size, grid_size)

        self.setBorderWidth(2)
        self.setCellPadding(4)
        self.setCellSpacing(1)

        self.setStyleName("gameboard") # just doesn't work

        # Set up game board 
        #
        # Note that must iterate over indices, rather than Cell
        # instances, until the table positions are set up here
        #
        index = 0   # debug
        for i in range(grid_size):
            for j in range(grid_size):
                cell = HTML(SPACE)
#                cell.setVisible(False)  # causes to ignore click events
                cell.position = (i, j)  # might be handy at some point
                index+=1; cell.index = index    # debug
#                cell.setStyleName("cell_O")
                cell.addClickListener(getattr(self, "onCellClicked"))
                self.setWidget(i, j, cell)
开发者ID:tmst,项目名称:Tic-Tac-Toe,代码行数:30,代码来源:tictactoe.py

示例3: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
 def __init__(self, loginPanel):
     Grid.__init__(self, 1, 1, StyleName="top-panel")
     self.loginPanel = loginPanel
     self.banner = banner.Banner()
     self.setWidget(0, 0, self.banner)
     formatter = self.getCellFormatter()
     formatter.setHorizontalAlignment(0, 0, "left")
     formatter.setVerticalAlignment(0, 0, "top")
开发者ID:jdunck,项目名称:Tickery,代码行数:10,代码来源:toppanel.py

示例4: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
    def __init__(self):

        Grid.__init__(self)

        self.targets=[]
        self.targets.append("app")
        #self.targets.append("ui")
        self.resize(len(self.targets)+1, 2)
        self.setBorderWidth("1px")
        self.counter=0

        self.setHTML(0, 0, "<b>Log</b>")
        self.setText(1, 0, "app")
        for i in range(len(self.targets)):
            target=self.targets[i]
            self.setText(i+1, 0, target)
开发者ID:Afey,项目名称:pyjs,代码行数:18,代码来源:MailLogger.py

示例5: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
    def __init__(self):
        Logger.instances.append(self)

        Grid.__init__(self, Visible=False)

        self.targets=[]
        self.targets.append("app")
        #self.targets.append("ui")
        self.resize(len(self.targets)+1, 2)
        self.setBorderWidth("1")
        self.counter=0
        
        self.setHTML(0, 0, "<b>Log</b>")
        self.setText(1, 0, "app")
        for i in range(len(self.targets)):
            target=self.targets[i]
            self.setText(i+1, 0, target)
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:19,代码来源:Logger.py

示例6: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
 def __init__(self):
     Grid.__init__(self, 1, 2, StyleName='login-panel')
     self.setCellPadding(0)
     self.setCellSpacing(0)
     formatter = self.getCellFormatter()
     # formatter.setWidth(0, 0, '100%')
     formatter.setHorizontalAlignment(0, 0, 'right')
     formatter.setHorizontalAlignment(0, 1, 'right')
     self.loggedIn = False
     self.screenname = None
     self.friendsIds = None
     self.userListPanels = []
     self.oauthCookie = Cookies.getCookie(defaults.OAUTH_COOKIE)
     if self.oauthCookie:
         remote = server.TickeryService()
         id = remote.screenameFromCookie(self.oauthCookie,
                                         DisplayLoggedIn(self))
         if id < 0:
             self.setWidget(0, 1, Label('oops: getScreenameFromCookie'))
     else:
         self.notLoggedIn()
开发者ID:fluidinfo,项目名称:Tickery,代码行数:23,代码来源:login.py

示例7: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
 def __init__(self):
     Grid.__init__(self)
     Abstract_View.__init__(self)
     self.selected_row = 0
     self.setStyleName('table')
     self.controller = None
开发者ID:mcsquaredjr,项目名称:Reports,代码行数:8,代码来源:common.py

示例8: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
 def __init__(self, topPanel):
     Grid.__init__(self, 1, 1, StyleName='about-panel')
     self.setWidget(0, 0, HTML(body, StyleName='about-body'))
开发者ID:jdunck,项目名称:Tickery,代码行数:5,代码来源:about.py

示例9: __init__

# 需要导入模块: from pyjamas.ui.Grid import Grid [as 别名]
# 或者: from pyjamas.ui.Grid.Grid import __init__ [as 别名]
 def __init__(self, sink):
     Grid.__init__(self)
     self.resize(1, 1)
     self.addTableListener(self)
     self.sink = sink
     self.selected_row = -1
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:8,代码来源:InfoDirectory.py


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