本文整理汇总了Python中pyjamas.ui.FlexTable.FlexTable.add方法的典型用法代码示例。如果您正苦于以下问题:Python FlexTable.add方法的具体用法?Python FlexTable.add怎么用?Python FlexTable.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.FlexTable.FlexTable
的用法示例。
在下文中一共展示了FlexTable.add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onModuleLoad
# 需要导入模块: from pyjamas.ui.FlexTable import FlexTable [as 别名]
# 或者: from pyjamas.ui.FlexTable.FlexTable import add [as 别名]
class CourseProfile:
def onModuleLoad(self):
self.mainPanel = VerticalPanel()
self.courseTable = FlexTable()
self.courseTable.setText(0, 0, 'Course Title: ')
self.courseTable.setText(1, 0, 'Course Description: ')
self.courseTable.setText(2, 0, 'Enroll: ')
self.courseTable.setText(3, 0, 'Friends: ')
self.mainPanel.add(self.courseTable)
RootPanel().add(self.mainPanel)
self.remote.getCourse(self)
def onRemoteResponse(self, response, request_info):
Window.alert(response)
row = self.ratingsTable.getRowCount()
name = response['name']
description = response['description']
enrolled = response['enrolled']
Window.alert(name)
## if enrolled:
## self.courseTable.add(2, 1, 'Enrolled!')
##
## else:
## def enrollClick(event):
## return
##
## self.courseTable.add(2, 1, Button('Enroll', enrollClick)
if name.isalpha() and description.isalpha():
self.courseTable.add(0, 1, name)
self.courseTable.add(1, 1, description)
def onRemoteError(self, code, message, request_info):
Window.alert(str(code) + "||" + str(message) + "||" + str(request_info))