本文整理汇总了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()
示例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)
示例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")
示例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)
示例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)
示例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()
示例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
示例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'))
示例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