def loadInterface(): username = body.firstElement().getValue() body.removeAll() #while(len(body) > 1): # body.remove(body.lastElement()) controller = ControllerActor(username) messages = MessageList(controller) body.add(messages, MessageForm(controller)) controller.get_messages(messages.display_messages)
def loadInterface(login_box): username = login_box.elementAt(1).getValue() while(len(login_box) > 1): login_box.remove(login_box.lastElement()) controller = ControllerActor(username) statuses = StatusList(controller) users = UserList(controller) statusform = StatusForm(controller, statuses) body.add(statusform, statuses, users) controller.getTimeline(statuses.displayStatuses)
def launch(): body.add(PostsList())
def launch(): login_box = Container().setAttribute('id', 'lb') user_field = TextBox().withPlaceholder("Enter your username...") login_button = Button('\'Login\'').onClick(loadInterface, login_box) body.add(login_box.add(P('Honker'), user_field, login_button))
def launch(): body.add(TextBox().withPlaceholder("Enter your username..."), Button('start').onClick(loadInterface))